欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript Ext JS 狀態(tài)默認(rèn)存儲(chǔ)時(shí)間

 更新時(shí)間:2009年02月15日 18:29:54   作者:  
通過ExtJS的源碼可以知道,ExtJS將Grid的自定義顯示列等自定義狀態(tài)信息存入Cookie中,默認(rèn)時(shí)間為7天
復(fù)制代碼 代碼如下:

Ext.state.CookieProvider = function(config){
Ext.state.CookieProvider.superclass.constructor.call(this);
this.path = "/";
this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days
this.domain = null;
this.secure = false;
Ext.apply(this, config);
this.state = this.readCookies();
};
Ext.state.CookieProvider = function(config){
Ext.state.CookieProvider.superclass.constructor.call(this);
this.path = "/";
this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days
this.domain = null;
this.secure = false;
Ext.apply(this, config);
this.state = this.readCookies();
};

我們可以通過設(shè)定expires的值來改變默認(rèn)的存儲(chǔ)時(shí)間,比如:
復(fù)制代碼 代碼如下:

this.expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年
this.expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年

或者我們可以在開始位置的Ext.onReady函數(shù)中加上以下的代碼
復(fù)制代碼 代碼如下:

Ext.state.Manager.setProvider(
new Ext.state.CookieProvider({
expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年
}));

相關(guān)文章

最新評論