openpsa / jsgrid

Fork of last jqGrid version before license change
http://openpsa.github.io/jsgrid/
Other
28 stars 12 forks source link

Investigate use of colgroup #59

Open flack opened 9 years ago

flack commented 9 years ago

Currently, if you set e.g. hidden: true in colModel, style="display: none" is added to each cell in the column. Performance might be better if we define a colgroup instead, because then the runtime for setting these properties would be O(1) instead of O(n). Markup would then look like this:

<table id="grid">
    <colgroup>
        <col style="display: none">
        <col style="text-align: right">
    </colgroup>
    <tr>
        <td>This is the hidden column</td>
        <td>This is the right-aligned column</td>
    </tr>
</table>
OlegKi commented 9 years ago

I agree with that the usage of colgroup can be helpful in general. I consider the feature some years before. Do you tested the code? Look at the demo.

The problem is that works not exactly how one want. One can apply only some small subset of specific CSS properties on visible columns. So the real help of colgroup is not so large.

meh-uk commented 9 years ago

It looks like you can style columns visibility - http://www.search-this.com/2007/04/11/styling-table-columns-with-css/

flack commented 9 years ago

Yes, I just tried that with Oleg's jsfiddle: If you replace display: none with visibility: collapse, it works as expected

smartcorestudio commented 9 years ago

Have you tried "visibility: collapse" on Blink-based browsers?

smartcorestudio commented 9 years ago

I've tested Oleg's fiddle with "visibility: collapse" on the latest Chrome and had no luck. Everything is OK on FF and IE.

flack commented 9 years ago

Hm, I guess you're right: Chrome (I tried 37) doesn't support that correctly

flack commented 9 years ago

Another option for improving rendering performance might be React:

http://facebook.github.io/react/

Unfortunately, their core lib is 130Kb, almost as big as the entire jqgrid. But maybe we can borrow a few ideas from them