1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.state.CookieProvider-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.state.CookieProvider-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.state.CookieProvider-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.state.CookieProvider-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.state.CookieProvider"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
9 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.state.Provider" ext:member="" href="output/Ext.state.Provider.html">Provider</a>
11 <img src="resources/elbow-end.gif"/>CookieProvider</pre></div>
12 <h1>Class Ext.state.CookieProvider</h1>
13 <table cellspacing="0">
14 <tr><td class="label">Package:</td><td class="hd-info">Ext.state</td></tr>
15 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/CookieProvider.js" target="_blank">CookieProvider.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">CookieProvider</td></tr>
17 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.state.Provider" ext:member="" href="output/Ext.state.Provider.html">Provider</a></td></tr>
19 <div class="description">
21 The default Provider implementation which saves state via cookies.
23 <pre><code>var cp = <b>new</b> Ext.state.CookieProvider({
24 path: <em>"/cgi-bin/"</em>,
25 expires: <b>new</b> Date(<b>new</b> Date().getTime()+(1000*60*60*24*30)), <i>//30 days</i>
26 domain: <em>"extjs.com"</em>
28 Ext.state.Manager.setProvider(cp);</code></pre> </div>
30 <div class="hr"></div>
31 <a id="Ext.state.CookieProvider-configs"></a>
32 <h2>Config Options</h2>
33 <table cellspacing="0" class="member-table">
35 <th class="sig-header" colspan="2">Config Options</th>
36 <th class="msource-header">Defined By</th>
38 <tr class="config-row expandable">
\r
39 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
41 <a id="Ext.state.CookieProvider-domain"></a>
\r
42 <b>domain</b> : String <div class="mdesc">
\r
43 <div class="short">The domain to save the cookie for. Note that you cannot specify a different domain than your page is on, but you can ...</div>
\r
45 The domain to save the cookie for. Note that you cannot specify a different domain than your page is on, but you can specify a sub-domain, or simply the domain itself like 'extjs.com' to include all sub-domains if you need to access cookies across different sub-domains (defaults to null which uses the same domain the page is running on including the 'www' like 'www.extjs.com') </div>
\r
48 <td class="msource">CookieProvider</td>
\r
50 <tr class="config-row alt">
\r
51 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
53 <a id="Ext.state.CookieProvider-expires"></a>
\r
54 <b>expires</b> : Date <div class="mdesc">
\r
55 The cookie expiration date (defaults to 7 days from now) </div>
\r
57 <td class="msource">CookieProvider</td>
\r
59 <tr class="config-row">
\r
60 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
62 <a id="Ext.state.CookieProvider-path"></a>
\r
63 <b>path</b> : String <div class="mdesc">
\r
64 The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site) </div>
\r
66 <td class="msource">CookieProvider</td>
\r
68 <tr class="config-row alt">
\r
69 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
71 <a id="Ext.state.CookieProvider-secure"></a>
\r
72 <b>secure</b> : Boolean <div class="mdesc">
\r
73 True if the site is using SSL (defaults to false) </div>
\r
75 <td class="msource">CookieProvider</td>
\r
78 <a id="Ext.state.CookieProvider-props"></a>
79 <h2>Public Properties</h2>
80 <div class="no-members">This class has no public properties.</div> <a id="Ext.state.CookieProvider-methods"></a>
81 <h2>Public Methods</h2>
82 <table cellspacing="0" class="member-table">
84 <th class="sig-header" colspan="2">Method</th>
85 <th class="msource-header">Defined By</th>
87 <tr class="method-row expandable">
\r
88 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
90 <a id="Ext.state.CookieProvider-CookieProvider"></a>
\r
91 <b>CookieProvider</b>( <code>Object config</code> ) <div class="mdesc">
\r
92 <div class="short">Create a new CookieProvider</div>
\r
94 Create a new CookieProvider <div class="mdetail-params">
\r
95 <strong>Parameters:</strong>
\r
96 <ul><li><code>config</code> : Object<div class="sub-desc">The configuration object</div></li> </ul>
\r
97 <strong>Returns:</strong>
\r
99 <li><code></code></li>
\r
105 <td class="msource">CookieProvider</td>
\r
107 <tr class="method-row inherited alt expandable">
\r
108 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
110 <a id="Ext.state.CookieProvider-clear"></a>
\r
111 <b>clear</b>( <code>String name</code> ) : void <div class="mdesc">
\r
112 <div class="short">Clears a value from the state</div>
\r
114 Clears a value from the state <div class="mdetail-params">
\r
115 <strong>Parameters:</strong>
\r
116 <ul><li><code>name</code> : String<div class="sub-desc">The key name</div></li> </ul>
\r
117 <strong>Returns:</strong>
\r
119 <li><code>void</code></li>
\r
125 <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#clear" href="output/Ext.state.Provider.html#clear">Provider</a></td>
\r
127 <tr class="method-row inherited expandable">
\r
128 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
130 <a id="Ext.state.CookieProvider-decodeValue"></a>
\r
131 <b>decodeValue</b>( <code>String value</code> ) : Mixed <div class="mdesc">
\r
132 <div class="short">Decodes a string previously encoded with <a ext:cls="Ext.state.Provider" ext:member="encodeValue" href="output/Ext.state.Provider.html#encodeValue">encodeValue</a>.</div>
\r
134 Decodes a string previously encoded with <a ext:cls="Ext.state.Provider" ext:member="encodeValue" href="output/Ext.state.Provider.html#encodeValue">encodeValue</a>. <div class="mdetail-params">
\r
135 <strong>Parameters:</strong>
\r
136 <ul><li><code>value</code> : String<div class="sub-desc">The value to decode</div></li> </ul>
\r
137 <strong>Returns:</strong>
\r
139 <li><code>Mixed</code><div class="sub-desc">The decoded value</div></li>
\r
145 <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#decodeValue" href="output/Ext.state.Provider.html#decodeValue">Provider</a></td>
\r
147 <tr class="method-row inherited alt expandable">
\r
148 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
150 <a id="Ext.state.CookieProvider-encodeValue"></a>
\r
151 <b>encodeValue</b>( <code>Mixed value</code> ) : String <div class="mdesc">
\r
152 <div class="short">Encodes a value including type information. Decode with <a ext:cls="Ext.state.Provider" ext:member="decodeValue" href="output/Ext.state.Provider.html#decodeValue">decodeValue</a>.</div>
\r
154 Encodes a value including type information. Decode with <a ext:cls="Ext.state.Provider" ext:member="decodeValue" href="output/Ext.state.Provider.html#decodeValue">decodeValue</a>. <div class="mdetail-params">
\r
155 <strong>Parameters:</strong>
\r
156 <ul><li><code>value</code> : Mixed<div class="sub-desc">The value to encode</div></li> </ul>
\r
157 <strong>Returns:</strong>
\r
159 <li><code>String</code><div class="sub-desc">The encoded value</div></li>
\r
165 <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#encodeValue" href="output/Ext.state.Provider.html#encodeValue">Provider</a></td>
\r
167 <tr class="method-row inherited expandable">
\r
168 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
170 <a id="Ext.state.CookieProvider-get"></a>
\r
171 <b>get</b>( <code>String name</code>, <code>Mixed defaultValue</code> ) : Mixed <div class="mdesc">
\r
172 <div class="short">Returns the current value for a key</div>
\r
174 Returns the current value for a key <div class="mdetail-params">
\r
175 <strong>Parameters:</strong>
\r
176 <ul><li><code>name</code> : String<div class="sub-desc">The key name</div></li><li><code>defaultValue</code> : Mixed<div class="sub-desc">A default value to return if the key's value is not found</div></li> </ul>
\r
177 <strong>Returns:</strong>
\r
179 <li><code>Mixed</code><div class="sub-desc">The state data</div></li>
\r
185 <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#get" href="output/Ext.state.Provider.html#get">Provider</a></td>
\r
187 <tr class="method-row inherited alt expandable">
\r
188 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
190 <a id="Ext.state.CookieProvider-set"></a>
\r
191 <b>set</b>( <code>String name</code>, <code>Mixed value</code> ) : void <div class="mdesc">
\r
192 <div class="short">Sets the value for a key</div>
\r
194 Sets the value for a key <div class="mdetail-params">
\r
195 <strong>Parameters:</strong>
\r
196 <ul><li><code>name</code> : String<div class="sub-desc">The key name</div></li><li><code>value</code> : Mixed<div class="sub-desc">The value to set</div></li> </ul>
\r
197 <strong>Returns:</strong>
\r
199 <li><code>void</code></li>
\r
205 <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#set" href="output/Ext.state.Provider.html#set">Provider</a></td>
\r
208 <a id="Ext.state.CookieProvider-events"></a>
209 <h2>Public Events</h2>
210 <table cellspacing="0" class="member-table">
212 <th class="sig-header" colspan="2">Event</th>
213 <th class="msource-header">Defined By</th>
215 <tr class="event-row inherited expandable">
\r
216 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
218 <a id="Ext.state.CookieProvider-statechange"></a>
\r
219 <b>statechange</b> : ( <code>Provider this</code>, <code>String key</code>, <code>String value</code> ) <div class="mdesc">
\r
220 <div class="short">Fires when a state change occurs.</div>
\r
222 Fires when a state change occurs. <div class="mdetail-params">
\r
223 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
224 <ul><li><code>this</code> : Provider<div class="sub-desc">This state provider</div></li><li><code>key</code> : String<div class="sub-desc">The state key which was changed</div></li><li><code>value</code> : String<div class="sub-desc">The encoded value for the state</div></li> </ul>
\r
229 <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#event-statechange" href="output/Ext.state.Provider.html#event-statechange">Provider</a></td>
\r