[CLOSED] Stateful grid

  1. #1

    [CLOSED] Stateful grid

    Hello guys

    I originally tried to reproduce other issue using your examples (see bottom of email about the details)

    but I face another strange behavior that I would like to ask:

    take this example

    https://examples4.ext.net/#/GridPane...l/Reconfigure/

    and just make grid statefull:

    	Stateful="True"
    	StateID="SampleStateId"

    The grid does not become statefull for some reason

    Can you explain why please ( if I reoder columns they will stay, if I hide or resize column it will stay after page refresh)


    Note that my original issue is about having statefull grid ( in my project and it really works) and after state is loaded I have problem adding dynamic columns on runtime

    var column = Ext.create('Ext.grid.column.Column', { text: 'Name', dataIndex: 'index' });
    this.headerCt.insert(this.columns.length + i, column);
    
    this.columns.push(column); // <- this is problematic line. columns does not have push method, its basically object with h1 - h10 proeprties}
    Feel free to ignore this note in this thread, just in case you see immediatelly I'm doing something wrong or not doable you can let me know now. otherwise I will try to setup reproducible example for you, once I understand whats wrong with grid on top

    Thanks
    Jiri
  2. #2
    Hello @jirihost!

    I don't think you can set up a stateful grid panel so simple as that. There are more steps involved, like setting up the state provider.

    For the example you pointed, the most basic change you should do to have the columns actually remember their sizes, besides what you pointed to change, would be adding StateProvider="LocalStorage" to the ResourceManager on the page.

    At least for the basic statefulness of the grid (of its main aspects) should do with just this setting. But it is as powerful and customizable as you may need, to see some, look at this example: advanced drag-drop > drag with state.

    You can also find more stateful related questions by searching forums (you can use a google search pattern like site:forums.ext.net stateful), and also some client-side implementation on Sencha Fiddle (if you search in description field for the terms you want, you usually get more results than searching titles).

    There's also online documentation on the client-side that may help you understand more the concept and the different ways it can use to save, restore and manage state on Sencha Documentation about Ext.State.

    Well, I hope this helps!

    note: I couldn't infer on anything by the snippet of code you provided so, as per your request, I've (almost completely) ignored it.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] grid panel problem with Stateful
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 15, 2014, 12:47 PM
  2. [CLOSED] Stateful ApplyState
    By vgvallee in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 05, 2013, 5:19 AM
  3. Stateful default false
    By Spamme in forum 1.x Help
    Replies: 3
    Last Post: Apr 04, 2012, 7:31 AM
  4. mvc do not support stateful?
    By sipo in forum 1.x Help
    Replies: 0
    Last Post: May 23, 2010, 7:23 AM
  5. Stateful accordion
    By Rod in forum 1.x Help
    Replies: 3
    Last Post: Nov 24, 2008, 10:46 AM

Posting Permissions