View Full Version : Grid State Restore

8 Nov 2013, 8:11 AM
I need to save and restore grid state.

To Save Grid State:
In my application, i am having grid panel.
On closing the application, i am getting the grid state and saving it in database.
var grdState = win.down('#itemID').getState();

To Restore Grid State:
While opening the application, In grid beforerender event, i am getting the value from database and applying state to the grid.

Grid state is applying the first time properly.
When i close and reopen the application, it is resetting to the initial state.

I need to save the grid state each time when user closes the application
and I need to restore it each time the window opens

Can you please someone tell me what is the problem here?

8 Nov 2013, 10:22 AM
Have you seen the grid panel example? http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/array-grid.html

There are several things to add: a state manager, whether the panel is stateful: true, and a stateId on the panel.

18 Nov 2013, 6:10 AM
Thanks for the response bartyhoho.

But by using cookies also is not working on all the times.
This is also worked only when i refresh the browser and open my application.
It is not working when i close and re-open the application.

18 Nov 2013, 6:50 AM
Post your code so we can see where the problem may lie.

18 Nov 2013, 11:08 PM
Thanks for the response bartyhoho.

I found the problem.
I have not set id for each column in the grid.
I had set itemId for each column. That works only on first time.
After i have set id for the columns, it is restoring while application re-opening also