[CLOSED] GridPanel - state for columns

  1. #1

    [CLOSED] GridPanel - state for columns

    Hi,

    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, https://examples1.ext.net/#/DragDrop...ag_with_State/ ,
    but nothing on how to do this on gridpanel.

    Can you, please, describe how to do this?


    /PatrikG
    Last edited by Daniil; Apr 20, 2012 at 6:49 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please read the Docs article of the stateful config option.
    http://docs.sencha.com/ext-js/4-0/#!...l-cfg-stateful
  3. #3

    On server?

    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"/>

    /PAtrik
  4. #4
    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:
    GridPanel1.getState();
    to save it on server.

    Then you can apply this saved state using the applyState method.
    GridPanel1.applyState(stateFromDatabase);

Similar Threads

  1. Toggle editable state of GridPanel on AjaxEvent.
    By howardyin in forum 2.x Help
    Replies: 2
    Last Post: Jul 04, 2012, 7:36 AM
  2. Save state of Locking GridPanel
    By sonnh11 in forum 1.x Help
    Replies: 0
    Last Post: May 25, 2012, 8:15 AM
  3. [CLOSED] GridPanel with many columns
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 04, 2011, 9:39 PM
  4. [CLOSED] Reset GridPanel columns to initial state
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jul 18, 2011, 5:21 PM
  5. How to add a tip for Gridpanel's Columns ?
    By Yanfang Wang in forum 1.x Help
    Replies: 8
    Last Post: Jun 07, 2010, 11:14 AM

Posting Permissions