commit extjs-2.2.1
[extjs.git] / docs / output / Ext.state.CookieProvider.html
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:\r
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">\r
39         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
40         <td class="sig">\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
44             <div class="long">\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
46                         </div>\r
47         </td>\r
48         <td class="msource">CookieProvider</td>\r
49     </tr>\r
50         <tr class="config-row alt">\r
51         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
52         <td class="sig">\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
56         </td>\r
57         <td class="msource">CookieProvider</td>\r
58     </tr>\r
59         <tr class="config-row">\r
60         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
61         <td class="sig">\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
65         </td>\r
66         <td class="msource">CookieProvider</td>\r
67     </tr>\r
68         <tr class="config-row alt">\r
69         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
70         <td class="sig">\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
74         </td>\r
75         <td class="msource">CookieProvider</td>\r
76     </tr>\r
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">\r
88         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
89         <td class="sig">\r
90         <a id="Ext.state.CookieProvider-CookieProvider"></a>\r
91             <b>CookieProvider</b>(&nbsp;<code>Object config</code>&nbsp;)            <div class="mdesc">\r
92                         <div class="short">Create a new CookieProvider</div>\r
93             <div class="long">\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
98         <ul>\r
99             <li><code></code></li>\r
100         </ul>\r
101     </div>\r
102                 </div>\r
103                         </div>\r
104         </td>\r
105         <td class="msource">CookieProvider</td>\r
106     </tr>\r
107         <tr class="method-row inherited alt expandable">\r
108         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
109         <td class="sig">\r
110         <a id="Ext.state.CookieProvider-clear"></a>\r
111             <b>clear</b>(&nbsp;<code>String name</code>&nbsp;) : void            <div class="mdesc">\r
112                         <div class="short">Clears a value from the state</div>\r
113             <div class="long">\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
118         <ul>\r
119             <li><code>void</code></li>\r
120         </ul>\r
121     </div>\r
122                 </div>\r
123                         </div>\r
124         </td>\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
126     </tr>\r
127         <tr class="method-row inherited expandable">\r
128         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
129         <td class="sig">\r
130         <a id="Ext.state.CookieProvider-decodeValue"></a>\r
131             <b>decodeValue</b>(&nbsp;<code>String value</code>&nbsp;) : 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
133             <div class="long">\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
138         <ul>\r
139             <li><code>Mixed</code><div class="sub-desc">The decoded value</div></li>\r
140         </ul>\r
141     </div>\r
142                 </div>\r
143                         </div>\r
144         </td>\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
146     </tr>\r
147         <tr class="method-row inherited alt expandable">\r
148         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
149         <td class="sig">\r
150         <a id="Ext.state.CookieProvider-encodeValue"></a>\r
151             <b>encodeValue</b>(&nbsp;<code>Mixed value</code>&nbsp;) : 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
153             <div class="long">\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
158         <ul>\r
159             <li><code>String</code><div class="sub-desc">The encoded value</div></li>\r
160         </ul>\r
161     </div>\r
162                 </div>\r
163                         </div>\r
164         </td>\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
166     </tr>\r
167         <tr class="method-row inherited expandable">\r
168         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
169         <td class="sig">\r
170         <a id="Ext.state.CookieProvider-get"></a>\r
171             <b>get</b>(&nbsp;<code>String name</code>, <code>Mixed defaultValue</code>&nbsp;) : Mixed            <div class="mdesc">\r
172                         <div class="short">Returns the current value for a key</div>\r
173             <div class="long">\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
178         <ul>\r
179             <li><code>Mixed</code><div class="sub-desc">The state data</div></li>\r
180         </ul>\r
181     </div>\r
182                 </div>\r
183                         </div>\r
184         </td>\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
186     </tr>\r
187         <tr class="method-row inherited alt expandable">\r
188         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
189         <td class="sig">\r
190         <a id="Ext.state.CookieProvider-set"></a>\r
191             <b>set</b>(&nbsp;<code>String name</code>, <code>Mixed value</code>&nbsp;) : void            <div class="mdesc">\r
192                         <div class="short">Sets the value for a key</div>\r
193             <div class="long">\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
198         <ul>\r
199             <li><code>void</code></li>\r
200         </ul>\r
201     </div>\r
202                 </div>\r
203                         </div>\r
204         </td>\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
206     </tr>\r
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">\r
216         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
217         <td class="sig">\r
218         <a id="Ext.state.CookieProvider-statechange"></a>\r
219             <b>statechange</b> : (&nbsp;<code>Provider this</code>, <code>String key</code>, <code>String value</code>&nbsp;)            <div class="mdesc">\r
220                         <div class="short">Fires when a state change occurs.</div>\r
221             <div class="long">\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
225     </div>\r
226                 </div>\r
227                         </div>\r
228         </td>\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
230     </tr>\r
231             </table>
232         
233         </div>