Reputation: 11148
In different data types I need to hide some columns (not one) from grid.
I'm using column.hide()
method, but it works too slow.
If I set hidden property to the column, I don't know method, that will refresh grid view.
If I do grid.view.refresh()
- header is still there.
How can I refresh grid after setting hidden:true properties?
Or some other way...
Upvotes: 0
Views: 2705
Reputation: 890
I had the same problem. I need to establish visibility and the size for columns. If I use standard methods, then it takes 24 seconds (~120 columns).
My solution:
var grid = ...;
for (var i = 0; i < grid.columns.length; i++) {
var column = grid.columns[i];
column.hidden = false // or true, instead column.setVisible(bool);
column.width = 100 // instead column.setWidth(100);
}
grid.headerCt.updateLayout();
Now it takes 114 ms instead 24 seconds.
Upvotes: 2