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> |
---|
8 | </div> |
---|
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> |
---|
18 | </table> |
---|
19 | <div class="description"> |
---|
20 | * |
---|
21 | The default Provider implementation which saves state via cookies. |
---|
22 | <br />Usage: |
---|
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> |
---|
27 | }); |
---|
28 | Ext.state.Manager.setProvider(cp);</code></pre> </div> |
---|
29 | |
---|
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"> |
---|
34 | <tr> |
---|
35 | <th class="sig-header" colspan="2">Config Options</th> |
---|
36 | <th class="msource-header">Defined By</th> |
---|
37 | </tr> |
---|
38 | <tr class="config-row expandable"> |
---|
39 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
40 | <td class="sig"> |
---|
41 | <a id="Ext.state.CookieProvider-domain"></a> |
---|
42 | <b>domain</b> : String <div class="mdesc"> |
---|
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> |
---|
44 | <div class="long"> |
---|
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> |
---|
46 | </div> |
---|
47 | </td> |
---|
48 | <td class="msource">CookieProvider</td> |
---|
49 | </tr> |
---|
50 | <tr class="config-row alt"> |
---|
51 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
52 | <td class="sig"> |
---|
53 | <a id="Ext.state.CookieProvider-expires"></a> |
---|
54 | <b>expires</b> : Date <div class="mdesc"> |
---|
55 | The cookie expiration date (defaults to 7 days from now) </div> |
---|
56 | </td> |
---|
57 | <td class="msource">CookieProvider</td> |
---|
58 | </tr> |
---|
59 | <tr class="config-row"> |
---|
60 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
61 | <td class="sig"> |
---|
62 | <a id="Ext.state.CookieProvider-path"></a> |
---|
63 | <b>path</b> : String <div class="mdesc"> |
---|
64 | The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site) </div> |
---|
65 | </td> |
---|
66 | <td class="msource">CookieProvider</td> |
---|
67 | </tr> |
---|
68 | <tr class="config-row alt"> |
---|
69 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
70 | <td class="sig"> |
---|
71 | <a id="Ext.state.CookieProvider-secure"></a> |
---|
72 | <b>secure</b> : Boolean <div class="mdesc"> |
---|
73 | True if the site is using SSL (defaults to false) </div> |
---|
74 | </td> |
---|
75 | <td class="msource">CookieProvider</td> |
---|
76 | </tr> |
---|
77 | </table> |
---|
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"> |
---|
83 | <tr> |
---|
84 | <th class="sig-header" colspan="2">Method</th> |
---|
85 | <th class="msource-header">Defined By</th> |
---|
86 | </tr> |
---|
87 | <tr class="method-row expandable"> |
---|
88 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
89 | <td class="sig"> |
---|
90 | <a id="Ext.state.CookieProvider-CookieProvider"></a> |
---|
91 | <b>CookieProvider</b>( <code>Object config</code> ) <div class="mdesc"> |
---|
92 | <div class="short">Create a new CookieProvider</div> |
---|
93 | <div class="long"> |
---|
94 | Create a new CookieProvider <div class="mdetail-params"> |
---|
95 | <strong>Parameters:</strong> |
---|
96 | <ul><li><code>config</code> : Object<div class="sub-desc">The configuration object</div></li> </ul> |
---|
97 | <strong>Returns:</strong> |
---|
98 | <ul> |
---|
99 | <li><code></code></li> |
---|
100 | </ul> |
---|
101 | </div> |
---|
102 | </div> |
---|
103 | </div> |
---|
104 | </td> |
---|
105 | <td class="msource">CookieProvider</td> |
---|
106 | </tr> |
---|
107 | <tr class="method-row inherited alt expandable"> |
---|
108 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
109 | <td class="sig"> |
---|
110 | <a id="Ext.state.CookieProvider-clear"></a> |
---|
111 | <b>clear</b>( <code>String name</code> ) : void <div class="mdesc"> |
---|
112 | <div class="short">Clears a value from the state</div> |
---|
113 | <div class="long"> |
---|
114 | Clears a value from the state <div class="mdetail-params"> |
---|
115 | <strong>Parameters:</strong> |
---|
116 | <ul><li><code>name</code> : String<div class="sub-desc">The key name</div></li> </ul> |
---|
117 | <strong>Returns:</strong> |
---|
118 | <ul> |
---|
119 | <li><code>void</code></li> |
---|
120 | </ul> |
---|
121 | </div> |
---|
122 | </div> |
---|
123 | </div> |
---|
124 | </td> |
---|
125 | <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#clear" href="output/Ext.state.Provider.html#clear">Provider</a></td> |
---|
126 | </tr> |
---|
127 | <tr class="method-row inherited expandable"> |
---|
128 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
129 | <td class="sig"> |
---|
130 | <a id="Ext.state.CookieProvider-decodeValue"></a> |
---|
131 | <b>decodeValue</b>( <code>String value</code> ) : Mixed <div class="mdesc"> |
---|
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> |
---|
133 | <div class="long"> |
---|
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"> |
---|
135 | <strong>Parameters:</strong> |
---|
136 | <ul><li><code>value</code> : String<div class="sub-desc">The value to decode</div></li> </ul> |
---|
137 | <strong>Returns:</strong> |
---|
138 | <ul> |
---|
139 | <li><code>Mixed</code><div class="sub-desc">The decoded value</div></li> |
---|
140 | </ul> |
---|
141 | </div> |
---|
142 | </div> |
---|
143 | </div> |
---|
144 | </td> |
---|
145 | <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#decodeValue" href="output/Ext.state.Provider.html#decodeValue">Provider</a></td> |
---|
146 | </tr> |
---|
147 | <tr class="method-row inherited alt expandable"> |
---|
148 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
149 | <td class="sig"> |
---|
150 | <a id="Ext.state.CookieProvider-encodeValue"></a> |
---|
151 | <b>encodeValue</b>( <code>Mixed value</code> ) : String <div class="mdesc"> |
---|
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> |
---|
153 | <div class="long"> |
---|
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"> |
---|
155 | <strong>Parameters:</strong> |
---|
156 | <ul><li><code>value</code> : Mixed<div class="sub-desc">The value to encode</div></li> </ul> |
---|
157 | <strong>Returns:</strong> |
---|
158 | <ul> |
---|
159 | <li><code>String</code><div class="sub-desc">The encoded value</div></li> |
---|
160 | </ul> |
---|
161 | </div> |
---|
162 | </div> |
---|
163 | </div> |
---|
164 | </td> |
---|
165 | <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#encodeValue" href="output/Ext.state.Provider.html#encodeValue">Provider</a></td> |
---|
166 | </tr> |
---|
167 | <tr class="method-row inherited expandable"> |
---|
168 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
169 | <td class="sig"> |
---|
170 | <a id="Ext.state.CookieProvider-get"></a> |
---|
171 | <b>get</b>( <code>String name</code>, <code>Mixed defaultValue</code> ) : Mixed <div class="mdesc"> |
---|
172 | <div class="short">Returns the current value for a key</div> |
---|
173 | <div class="long"> |
---|
174 | Returns the current value for a key <div class="mdetail-params"> |
---|
175 | <strong>Parameters:</strong> |
---|
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> |
---|
177 | <strong>Returns:</strong> |
---|
178 | <ul> |
---|
179 | <li><code>Mixed</code><div class="sub-desc">The state data</div></li> |
---|
180 | </ul> |
---|
181 | </div> |
---|
182 | </div> |
---|
183 | </div> |
---|
184 | </td> |
---|
185 | <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#get" href="output/Ext.state.Provider.html#get">Provider</a></td> |
---|
186 | </tr> |
---|
187 | <tr class="method-row inherited alt expandable"> |
---|
188 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
189 | <td class="sig"> |
---|
190 | <a id="Ext.state.CookieProvider-set"></a> |
---|
191 | <b>set</b>( <code>String name</code>, <code>Mixed value</code> ) : void <div class="mdesc"> |
---|
192 | <div class="short">Sets the value for a key</div> |
---|
193 | <div class="long"> |
---|
194 | Sets the value for a key <div class="mdetail-params"> |
---|
195 | <strong>Parameters:</strong> |
---|
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> |
---|
197 | <strong>Returns:</strong> |
---|
198 | <ul> |
---|
199 | <li><code>void</code></li> |
---|
200 | </ul> |
---|
201 | </div> |
---|
202 | </div> |
---|
203 | </div> |
---|
204 | </td> |
---|
205 | <td class="msource"><a ext:cls="Ext.state.Provider" ext:member="#set" href="output/Ext.state.Provider.html#set">Provider</a></td> |
---|
206 | </tr> |
---|
207 | </table> |
---|
208 | <a id="Ext.state.CookieProvider-events"></a> |
---|
209 | <h2>Public Events</h2> |
---|
210 | <table cellspacing="0" class="member-table"> |
---|
211 | <tr> |
---|
212 | <th class="sig-header" colspan="2">Event</th> |
---|
213 | <th class="msource-header">Defined By</th> |
---|
214 | </tr> |
---|
215 | <tr class="event-row inherited expandable"> |
---|
216 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
217 | <td class="sig"> |
---|
218 | <a id="Ext.state.CookieProvider-statechange"></a> |
---|
219 | <b>statechange</b> : ( <code>Provider this</code>, <code>String key</code>, <code>String value</code> ) <div class="mdesc"> |
---|
220 | <div class="short">Fires when a state change occurs.</div> |
---|
221 | <div class="long"> |
---|
222 | Fires when a state change occurs. <div class="mdetail-params"> |
---|
223 | <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong> |
---|
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> |
---|
225 | </div> |
---|
226 | </div> |
---|
227 | </div> |
---|
228 | </td> |
---|
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> |
---|
230 | </tr> |
---|
231 | </table> |
---|
232 | |
---|
233 | </div> |
---|