4 Apr 2009 3:50 AM #1
How can i save Grid state using GXT?
Is it possible to save grid sort and grouping state in to coockies or in DB?
In GXT There are some classes at com.extjs.gxt.ui.client.state this location. These are StateManager, Provider and CoockieProvider. Using this i think it is possible.
I have tried some approaches using these classes but it doesn't work?
please help, thanks in advance.
9 Apr 2009 6:41 AM #2
Save State using Cookie Provider
Follwoing is the code that i had tried save State of Grid in GXT using CookieProvieder class.
I created object cookie added some values.
SaveState is object having getter setter for some propertied.
CookieProvider cookie = new CookieProvider(null, null ,null, true);
SaveState state = new SaveState();
But not getting how to fetch this object cookie on load of Grid to reset state.
Please help if any one having idea about save state using CookieProvider.
Last edited by Rupesh; 9 Apr 2009 at 6:46 AM. Reason: title
29 May 2009 4:47 AM #3
To store states in a database, you must provide a specific provider to the StateManager (The default provider is CookieProvider). The best way is to create a RpcStateProvider.
Create a new class which implements Provider abstract class. Then create a new instance of this class and then set it to the StateManager:
I've done such provider and a PreferenceManager window which is able to save user interface preferences (typically a grid preference : column visibility, grouping, column order, ...) to a XML file on the server side. Currently I have to refactor my code to separate our specific code.
5 Aug 2009 3:57 AM #4
need your help on grid state storing
I am also looking for the grid state save stuff.
I think by this time you got the solution. Can you please share with me how you have achieved?
4 Dec 2009 11:29 AM #5
I need to do some thing similar. I need to save the state of the Grid in database or xml file. So, if a user deletes a column from Grid, the next time when he generates the grid I don't want to display the column that was deleted from the Grid. Can you please provide me a sample code or example on how to do this?
17 Jan 2011 4:31 AM #6
I need to save the state of the Grid in database using java . Can you please provide me a sample code or example on how to do this?