PDA

View Full Version : Hiding and showing columns, working slow



himan
29 Apr 2010, 8:07 PM
I m having a GridPanel with many columns
In the grid i m hiding and showing columns several time, using setHidden(),


for(var j = 0;j<gridColsIdArr.length-1; j++)
{
colModelForView.setHidden(colModelForView.getIndexById(gridColsIdArr[j]), true); //hiding all columns of grid
}
for(var k = 0;k<showColArrId.length; k++)
{
colModelForView.setHidden(colModelForView.getIndexById(showColArrId[k]), false); // showing user view columns only
// colModelForView.setColumnWidth(colModelForView.getIndexById(showColArrId[k]),80,false);
//alert('a');
}
Here gridColsIdArr is array of column Id which i have to hide, and showColArrId is array of column to show.
colModelForView is columnModel of my grid.
Everything is working fine when number of records in grid are less, but as the number of records increases it starts working very slow(means hiding and showing of columns are working slow), is there any other way to hide show columns or how can i solve this.
plzz some one reply...

kudos_ni_
18 Oct 2010, 10:11 AM
Did you find a solution to this? I am having the same issue with very slow running of setHidden function.

ikovaltaras
25 Oct 2010, 9:40 AM
same for me, event with 6 columns.

Animal
30 Oct 2010, 12:32 AM
Of course!

You are re-rendering the whole heavyweight grid markup six times in a row!

This is what suspendEvents is for.

Animal
30 Oct 2010, 12:32 AM
BTW, this is NOT an Ext Core issue.

It's Ext JS.