• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] Save multiple gridstates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] Save multiple gridstates

    Hi all,

    For an new project to write in Valence, i would like the users to have the ability to save their current gridlayout (width-sort-lock-hidden cols, etc..) on server-level (and give the layout a proper name)

    So they could reload a 'saved-custom' layout on demand.
    I'd like to have them on the server because what i'd also like is that a user can choose to save a layout as 'Private' or as 'Public'.. meaning they would also be accessible for other users.

    So far i've found on forums lots of topics for saving the state of a grid into a cookie.. but that's not really what i want to do...

    can you help me on the way on how this could be done... or where i could find more info on that


    thx

    Thierry

  • #2
    Thierry,

    You could loop through the grid columns to get its properties. Some thing like:

    Code:
    var cols = grid.columns;
    var colProperties =[];
    Ext.each(cols, function(col){
    	colProperties.push({
    	     dataindex:col.dataIndex,
                 width: col.width,
    	     hidden:col.isHidden()
            });
    });
    You can then fire an ajax call passing this array of properties to save it on your server-side. You would have to retrieve these properties and apply them to the columns when user picks the specific layout.

    I should say this is not an efficient way of doing it, especially if grid has lots of columns. I would be interested to know, if you figured out a better way to do it.

    Comment


    • #3
      thx... i'll have my way into it..
      i'll let you know the result


      thx for the advice

      Comment

      Working...
      X