Clear Up
SharpKit Reference

StatefulConfig Class

Namespace: Ext.state

Base Types



Name Description


Name Description
saveDelay A buffer to be applied if many state events are fired within a short period. Defaults to: 100
stateEvents An array of events that, when fired, should trigger this object to save its state. Defaults to none. stateEvents may be any type of event supported by this object, including browser or custom events (e.g., ['click', 'customerchange']). See stateful for an explanation of saving and restoring object state.
stateful A flag which causes the object to attempt to restore the state of internal properties from a saved state on startup. The object must have a stateId for state to be managed. Auto-generated ids are not guaranteed to be stable across page loads and cannot be relied upon to save and restore the same state for a object. For state saving to work, the state manager's provider must have been set to an implementation of Ext.state.Provider which overrides the set and get methods to save and recall name/value pairs. A built-in implementation, Ext.state.CookieProvider is available. To set the state provider for the current page: Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
})); A stateful object attempts to save state when one of the events listed in the stateEvents configuration fires. To save state, a stateful object first serializes its state by calling getState . The Component base class implements getState to save its width and height within the state only if they were initially configured, and have changed from the configured value. The Panel class saves its collapsed state in addition to that. The Grid class saves its column state in addition to its superclass state. If there is more application state to be save, the developer must provide an implementation which first calls the superclass method to inherit the above behaviour, and then injects new properties into the returned object. The value yielded by getState is passed to Ext.state.Manager.set which uses the configured Ext.state.Provider to save the object keyed by the stateId. During construction, a stateful object attempts to restore its state by calling Ext.state.Manager.get passing the stateId The resulting object is passed to applyState*. The default implementation of applyState simply copies properties into the object, but a developer may override this to support restoration of more complex application state. You can perform extra processing on state save and restore by attaching handlers to the beforestaterestore, staterestore, beforestatesave and statesave events. Defaults to: false
stateId The unique id for this object to use for state management purposes. See stateful for an explanation of saving and restoring state.
© Copyright 2005-2011 SharpKit. All rights reserved.