View Full Version : GridPanel save collapsed state [Calling "overriden" function]

15 Dec 2010, 4:55 AM
I need to save the state of the GridPanel including information if it is collapsed or not.

To do this I need to add:
['collapse', 'expand'] to the stateEvents
and add few lines in getState function which will also include this.collapsed

So I need something like this:

serversGrid = new Ext.grid.GridPanel({
collapsible : true,
stateful: true,
stateId: 'dashboard_license_servers',
stateEvents: ['collapse', 'expand'].concat((new Ext.grid.GridPanel).stateEvents), // can I do this better way?
getState: function (){
var state = ????; // how to call original getState() on current object when I'm just overriding it?
state.collapsed = this.collapsed;

return state;

Or am I doing it all wrong?