PDA

View Full Version : EditorGridPanel - restore columnModel by default



vStyle
19 Jan 2011, 10:32 PM
Hi there,
I have set the following gridPanel/columnModel listeners: (columnmoved, hiddenchange, columnresize, sortchange) and save all grid changes in cookies, then on page reload I set saved options back. All works great.
Also I have add new button to bbar named 'Restore Grid Configs', I wish to restore columnModel by default clicking on this button.

What I do:
1. Save current configs before change them based on cookie entries.

var savedConfigs = grid.initialConfig;2. Set saved configs on my button click

columnModel.setConfig(savedConfigs);This way works bad and hide whole column model :(

Is there any good method to restore grid/columnModel?
Thanks

John

vStyle
20 Jan 2011, 4:31 AM
To bad explanation? I can rephrase if needs )

vStyle
20 Jan 2011, 8:36 PM
Have found solution.

darthwes
20 Jan 2011, 9:27 PM
I'd check out Ext.grid.GridPanel (http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.GridPanel).reconfigure