Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
This is the global state manager. By default all components that are "state aware" check this class for state information if you don't pass them a custom state provider. In order for this class to be useful, it must be initialized with a provider when your application initializes.這是Ext官方對state.Manager的解釋,意思大概是說數據庫
這是一個全局的狀態管理器,缺省狀況「狀態」是激活的,若是自定義的狀態提供器沒法工做,請檢查「狀態」的信息,爲了使這個類生效,你必須在你的程 序初始化的時候爲這個「狀態」初始化其提供器,CookieProvider是缺省的提供器,是用cookie的方式保存狀態信息 The default Provider implementation which saves state via cookies.不知道Ext之後可否提供狀態保存在數據庫裏面,這樣用戶上次使用的狀態結果就能夠在下次用戶登錄的時候保留下來。
初始化Ext狀態管理器,在Cookie中記錄用戶的操做狀態,若是不啓用,刷新時就不會保存當前的狀態,而是從新加載。若是窗口中 有用可拖動面板的話,你在拖動後若是啓動了Ext.state.Manager.setProvider(new Ext.state.CookieProvider()),就算刷新後面板仍然會在你拖動後的位置。若是不啓用的話是否是就會按照默認的排列方式排列
- Ext.state.Manager.setProvider(
- new Ext.state.CookieProvider({
- expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年後
- }));