PDA

View Full Version : Grid Column Toggle



josebalius
5 May 2010, 6:43 AM
Hey everyone, I am working on a grid for my job and I have ran into a bit of a problem. I need to be able to show an X set of rows at first, then if the user clicks the toggle button, some of the rows should disappear and hidden ones should show. All of the data is loaded on the first load, the issue is that it is taking over 10 seconds to do the toggle, compared to an old grid the company uses that does it in a second or two. I am trying to push ExtJS and I need this to work as fast as possible. Here is the handler for the toggle button:



var gridC = grid.getColumnModel();

if(toggle == 1) {
gridC.setHidden(gridC.findColumnIndex('aug'), false);
gridC.setHidden(gridC.findColumnIndex('sep'), true);
} else if(toggle == 2) {
gridC.setHidden(gridC.findColumnIndex('aug'), true);
gridC.setHidden(gridC.findColumnIndex('sep'), false);
}



Is there a better way to do this?

Thanks!

wm003
5 May 2010, 7:48 AM
Sounds, like the grid has many,many rows and/or many many columns.
In case of many rows, try using Ext.PagingToolbar (http://www.extjs.com/deploy/dev/docs/output/Ext.PagingToolbar.html) or Ext.ux.LiveGrid (http://www.extjs.com/forum/showthread.php?17791-Ext.ux.LiveGrid&highlight=livegrid) for better grid performance

josebalius
5 May 2010, 8:02 AM
It is 30 columns and we limit it to 30 rows with the paging toolbar, any other suggestions?

Thank you!

josebalius
6 May 2010, 5:06 AM
Does anyone else have any input? Please and thank you.