Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / source / DirectStore.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5   <title>The source code</title>
6   <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7   <script type="text/javascript" src="../prettify/prettify.js"></script>
8   <style type="text/css">
9     .highlight { display: block; background-color: #ddd; }
10   </style>
11   <script type="text/javascript">
12     function highlight() {
13       document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14     }
15   </script>
16 </head>
17 <body onload="prettyPrint(); highlight();">
18   <pre class="prettyprint lang-js"><span id='Ext-data-DirectStore'>/**
19 </span> * @class Ext.data.DirectStore
20  * @extends Ext.data.Store
21  * &lt;p&gt;Small helper class to create an {@link Ext.data.Store} configured with an
22  * {@link Ext.data.proxy.Direct} and {@link Ext.data.reader.Json} to make interacting
23  * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier.
24  * To create a different proxy/reader combination create a basic {@link Ext.data.Store}
25  * configured as needed.&lt;/p&gt;
26  *
27  * &lt;p&gt;&lt;b&gt;*Note:&lt;/b&gt; Although they are not listed, this class inherits all of the config options of:&lt;/p&gt;
28  * &lt;div&gt;&lt;ul class=&quot;mdetail-params&quot;&gt;
29  * &lt;li&gt;&lt;b&gt;{@link Ext.data.Store Store}&lt;/b&gt;&lt;/li&gt;
30  * &lt;div class=&quot;sub-desc&quot;&gt;&lt;ul class=&quot;mdetail-params&quot;&gt;
31  *
32  * &lt;/ul&gt;&lt;/div&gt;
33  * &lt;li&gt;&lt;b&gt;{@link Ext.data.reader.Json JsonReader}&lt;/b&gt;&lt;/li&gt;
34  * &lt;div class=&quot;sub-desc&quot;&gt;&lt;ul class=&quot;mdetail-params&quot;&gt;
35  * &lt;li&gt;&lt;tt&gt;&lt;b&gt;{@link Ext.data.reader.Json#root root}&lt;/b&gt;&lt;/tt&gt;&lt;/li&gt;
36  * &lt;li&gt;&lt;tt&gt;&lt;b&gt;{@link Ext.data.reader.Json#idProperty idProperty}&lt;/b&gt;&lt;/tt&gt;&lt;/li&gt;
37  * &lt;li&gt;&lt;tt&gt;&lt;b&gt;{@link Ext.data.reader.Json#totalProperty totalProperty}&lt;/b&gt;&lt;/tt&gt;&lt;/li&gt;
38  * &lt;/ul&gt;&lt;/div&gt;
39  *
40  * &lt;li&gt;&lt;b&gt;{@link Ext.data.proxy.Direct DirectProxy}&lt;/b&gt;&lt;/li&gt;
41  * &lt;div class=&quot;sub-desc&quot;&gt;&lt;ul class=&quot;mdetail-params&quot;&gt;
42  * &lt;li&gt;&lt;tt&gt;&lt;b&gt;{@link Ext.data.proxy.Direct#directFn directFn}&lt;/b&gt;&lt;/tt&gt;&lt;/li&gt;
43  * &lt;li&gt;&lt;tt&gt;&lt;b&gt;{@link Ext.data.proxy.Direct#paramOrder paramOrder}&lt;/b&gt;&lt;/tt&gt;&lt;/li&gt;
44  * &lt;li&gt;&lt;tt&gt;&lt;b&gt;{@link Ext.data.proxy.Direct#paramsAsHash paramsAsHash}&lt;/b&gt;&lt;/tt&gt;&lt;/li&gt;
45  * &lt;/ul&gt;&lt;/div&gt;
46  * &lt;/ul&gt;&lt;/div&gt;
47  */
48
49 Ext.define('Ext.data.DirectStore', {
50     /* Begin Definitions */
51     
52     extend: 'Ext.data.Store',
53     
54     alias: 'store.direct',
55     
56     requires: ['Ext.data.proxy.Direct'],
57    
58     /* End Definitions */
59
60 <span id='Ext-data-DirectStore-method-constructor'>    /**
61 </span>     * @param {Object} config (optional) Config object.
62      */
63     constructor : function(config){
64         config = Ext.apply({}, config);
65         if (!config.proxy) {
66             var proxy = {
67                 type: 'direct',
68                 reader: {
69                     type: 'json'
70                 }
71             };
72             Ext.copyTo(proxy, config, 'paramOrder,paramsAsHash,directFn,api,simpleSortMode');
73             Ext.copyTo(proxy.reader, config, 'totalProperty,root,idProperty');
74             config.proxy = proxy;
75         }
76         this.callParent([config]);
77     }    
78 });
79 </pre>
80 </body>
81 </html>