Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to save and load the settings of ListGrid.

    What I want to achieve is the following:

    If I change the column order of a ListGrid, and set default sort column, the system can save the state of such settings, and next time when application is loaded, the setting will be loaded.

    Is it possible by some easier way? I assume it is possible to make such structure as ordinal software configuration way. (using some xml or ini files to set such values and save and load them.)

    #2
    Have you seen the Grid Preferences sample? As you can tell from the sample the grid preferences / state can be captured as a string and then you can restore it by calling listGrid.setViewState(String) within a ListGrid.addDrawHandler(..) callback.

    You can write application code to persist the view state in your database or server and read it when your application loads. Alternatively you can use the new Offline storage functionality recently added to Smart GWT. Here's a sample that stores the user's grid preferences using offline storage and upon reloading the app, the ListGrid preferences are restored from the offline storage.

    You can find the source code for the Offline Storage ListGrid preferences sample here.

    Sanjiv

    Comment


      #3
      Thank you sjivan. This is what I wanted!

      Comment


        #4
        I just got around to trying this feature and it is great. However, my group by selection was not saved. Is that an omission?

        Comment


          #5
          Currently group-by state is not supported.

          Comment

          Working...
          X