3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.state.Manager"></div>/**
\r
10 * @class Ext.state.Manager
\r
11 * This is the global state manager. By default all components that are "state aware" check this class
\r
12 * for state information if you don't pass them a custom state provider. In order for this class
\r
13 * to be useful, it must be initialized with a provider when your application initializes. Example usage:
\r
15 // in your initialization function
\r
17 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
\r
18 var win = new Window(...);
\r
24 Ext.state.Manager = function(){
\r
25 var provider = new Ext.state.Provider();
\r
28 <div id="method-Ext.state.Manager-setProvider"></div>/**
\r
29 * Configures the default state provider for your application
\r
30 * @param {Provider} stateProvider The state provider to set
\r
32 setProvider : function(stateProvider){
\r
33 provider = stateProvider;
\r
36 <div id="method-Ext.state.Manager-get"></div>/**
\r
37 * Returns the current value for a key
\r
38 * @param {String} name The key name
\r
39 * @param {Mixed} defaultValue The default value to return if the key lookup does not match
\r
40 * @return {Mixed} The state data
\r
42 get : function(key, defaultValue){
\r
43 return provider.get(key, defaultValue);
\r
46 <div id="method-Ext.state.Manager-set"></div>/**
\r
47 * Sets the value for a key
\r
48 * @param {String} name The key name
\r
49 * @param {Mixed} value The state data
\r
51 set : function(key, value){
\r
52 provider.set(key, value);
\r
55 <div id="method-Ext.state.Manager-clear"></div>/**
\r
56 * Clears a value from the state
\r
57 * @param {String} name The key name
\r
59 clear : function(key){
\r
60 provider.clear(key);
\r
63 <div id="method-Ext.state.Manager-getProvider"></div>/**
\r
64 * Gets the currently configured state provider
\r
65 * @return {Provider} The state provider
\r
67 getProvider : function(){
\r