PDA

View Full Version : Save state of the grid columns



asavchuk
9 Sep 2013, 4:39 PM
Right now I set my grid to save it's state.
however, I do not want to save column width, column position, column order and so on, I need only column hide / show information and everything else always be the same..

Is there a way to store only column hide /show state? And when back to App just hide / show column based on stored state?

ettavolt
9 Sep 2013, 10:48 PM
Of course, but you will need to override collect and restore state methods and all the thing yourself.

asavchuk
10 Sep 2013, 7:45 AM
any sample how to override collect and restore method, but only for certain grid?

ettavolt
10 Sep 2013, 9:08 PM
You need to specify applyState (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.state.Stateful-method-applyState) and getState (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.state.Stateful-method-getState) methods on an instance of your grid. For details on state processing I suggest to take a look into Ext.state package.