View Full Version : [CLOSED] GridPanel - state for columns

Apr 13, 2012, 12:21 PM

I can't find any example discribing/showing how to maintain changes a user might do to column in a gridpanel.
I would like to store settings from a gridpanel in a database/server.
If the user changes size, sortorder, closes on colum this change should be saved in a table.
I can find an example on how to save a certain state in a cookie, http://examples1.ext.net/#/DragDrop/Advanced/Drag_with_State/ ,
but nothing on how to do this on gridpanel.

Can you, please, describe how to do this?


Apr 13, 2012, 12:54 PM

Please read the Docs article of the stateful config option.

Apr 13, 2012, 1:43 PM
Is there a way to get this event triggered server side?

I've tried the following:

this.GridPanel.Stateful = true;
this.GridPanel.StateEvents = new string[] { "columnresize", "columnmove", "columnvisible", "columnsort" };
this.GridPanel.StateID = "ABC";
this.GridPanel.StateChanged +=new EventHandler(GridPanel_StateChanged);

I'm not sure that its the gridPanels state I want to be listen to capture changes on columns?!

And added:

<customConfig> <ext:ConfigItem Name="stateful" Value="true" Mode="Raw" /></CustomConfig>
to the grid in markup.

The stateProvider is set as:

<ext:ResourceManager ID="ResourceManager1" runat="server" StateProvider="PostBack"/>


Apr 13, 2012, 1:48 PM
It should be done client side.

Though you always can get a client side data on server passing it from client and otherwise.

Generally, many things are saved by default in GridPanel. So, you can start from this default functionality.

You can get GridPanel state on client:

to save it on server.

Then you can apply this saved state using the applyState method.