javascript Ext JS state default storage time_extjs
May 16, 2016 pm 06:56 PMExt.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();
};
We can set expires value to change the default storage time, for example:
this. expires: new Date(new Date().getTime() (1000*60*60*24*365)), //One year
this.expires: new Date(new Date().getTime() (1000 *60*60*24*365)), //One year
Or we can add the following code to the Ext.onReady function at the beginning
Ext.state.Manager.setProvider(
new Ext.state.CookieProvider({
expires: new Date(new Date().getTime() (1000*60*60*24*365)), //One year
}));

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

Recommended: Excellent JS open source face detection and recognition project

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

An in-depth discussion of the physical storage structure of the Linux ext2 file system

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts

How to use JavaScript and WebSocket to implement a real-time online ordering system

JavaScript and WebSocket: Building an efficient real-time weather forecasting system
