Search code examples
javascriptextjsextjs4extjs4.2extjs5

ExtJS: StateId, what are they used for ? and where are they stored?


I have started extending a extjs application and I notice most of the views have a stateId, including Windows, GridPanels.

I would like to understand what these are, i presume they store some sort of state ? Where is this information stored ? It seems to be client state so no session involved ? I have checked the cookies and localStorage but I can't identify exactly where it is storing this information, how long the state lasts.

I tried searching the docs on this and couldn't find anything specific. Maybe I am looking in the wrong place?


Solution

  • The stateId is used to memorize the current state of a component:

    https://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.state.Manager https://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.state.Provider

    For example, you can save the state of gridcolumns and if the user reorder them or hide them this will be saved. The next time the user comes back the state is still there. The state can be saved in the local storage or in a cookie.