1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-data.proxy.SessionStorage'>/**
2 </span> * @author Ed Spencer
3 * @class Ext.data.proxy.SessionStorage
4 * @extends Ext.data.proxy.WebStorage
6 * <p>Proxy which uses HTML5 session storage as its data storage/retrieval mechanism.
7 * If this proxy is used in a browser where session storage is not supported, the constructor will throw an error.
8 * A session storage proxy requires a unique ID which is used as a key in which all record data are stored in the
9 * session storage object.</p>
11 * <p>It's important to supply this unique ID as it cannot be reliably determined otherwise. If no id is provided
12 * but the attached store has a storeId, the storeId will be used. If neither option is presented the proxy will
13 * throw an error.</p>
15 * <p>Proxies are almost always used with a {@link Ext.data.Store store}:<p>
17 <pre><code>
20 type: 'sessionstorage',
24 </code></pre>
26 * <p>Alternatively you can instantiate the Proxy directly:</p>
28 <pre><code>
29 new Ext.data.proxy.SessionStorage({
30 id : 'myOtherProxyKey'
32 </code></pre>
34 * <p>Note that session storage is different to local storage (see {@link Ext.data.proxy.LocalStorage}) - if a browser
35 * session is ended (e.g. by closing the browser) then all data in a SessionStorageProxy are lost. Browser restarts
36 * don't affect the {@link Ext.data.proxy.LocalStorage} - the data are preserved.</p>
38 Ext.define('Ext.data.proxy.SessionStorage', {
39 extend: 'Ext.data.proxy.WebStorage',
40 alias: 'proxy.sessionstorage',
41 alternateClassName: 'Ext.data.SessionStorageProxy',
44 getStorageObject: function() {
45 return window.sessionStorage;
48 </pre></pre></body></html>