PDA

View Full Version : State Management Help



Hollywood
3 Aug 2010, 10:54 PM
Hey Guys,

Could anyone please elaborate what exactly this line does and when to use this ??



Ext.state.Manager.setProvider(new Ext.state.CookieProvider());


Would seriously appreciate the help,

Regards,

Hw

Condor
4 Aug 2010, 12:32 AM
Some Ext components have build-in state management (Ext.Window, Ext.layout.BorderLayout.Region, Ext.grid.GridPanel). These components can load/save their current state (size, position etc.) from/to the state manager.

The state manager uses a provider to retrieve/store the state. One possible provider is a CookieProvider which stores the state in a cookie. There are other providers available that e.g. store the state on the server.

Hollywood
4 Aug 2010, 12:54 AM
Thanks a lot condor for helping me on this one.

Another doubt that i had was whether the state of the components such as Grid etc. would still be saved/loaded when we dont specify this line


Ext.state.Manager.setProvider(new Ext.state.CookieProvider());


Which is the default state provider?

Thanks again,

Hw

Condor
4 Aug 2010, 1:21 AM
The default Ext.state.Provider uses an object hash to store the states (so the state isn't remembered across pages).