3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.data.DirectStore"></div>/**
\r
10 * @class Ext.data.DirectStore
\r
11 * @extends Ext.data.Store
\r
12 * <p>Small helper class to create an {@link Ext.data.Store} configured with an
\r
13 * {@link Ext.data.DirectProxy} and {@link Ext.data.JsonReader} to make interacting
\r
14 * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier.
\r
15 * To create a different proxy/reader combination create a basic {@link Ext.data.Store}
\r
16 * configured as needed.</p>
\r
18 * <p><b>*Note:</b> Although they are not listed, this class inherits all of the config options of:</p>
\r
19 * <div><ul class="mdetail-params">
\r
20 * <li><b>{@link Ext.data.Store Store}</b></li>
\r
21 * <div class="sub-desc"><ul class="mdetail-params">
\r
24 * <li><b>{@link Ext.data.JsonReader JsonReader}</b></li>
\r
25 * <div class="sub-desc"><ul class="mdetail-params">
\r
26 * <li><tt><b>{@link Ext.data.JsonReader#root root}</b></tt></li>
\r
27 * <li><tt><b>{@link Ext.data.JsonReader#idProperty idProperty}</b></tt></li>
\r
28 * <li><tt><b>{@link Ext.data.JsonReader#totalProperty totalProperty}</b></tt></li>
\r
31 * <li><b>{@link Ext.data.DirectProxy DirectProxy}</b></li>
\r
32 * <div class="sub-desc"><ul class="mdetail-params">
\r
33 * <li><tt><b>{@link Ext.data.DirectProxy#directFn directFn}</b></tt></li>
\r
34 * <li><tt><b>{@link Ext.data.DirectProxy#paramOrder paramOrder}</b></tt></li>
\r
35 * <li><tt><b>{@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}</b></tt></li>
\r
39 * @xtype directstore
\r
42 * @param {Object} config
\r
44 Ext.data.DirectStore = Ext.extend(Ext.data.Store, {
\r
45 constructor : function(config){
\r
46 // each transaction upon a singe record will generate a distinct Direct transaction since Direct queues them into one Ajax request.
\r
47 var c = Ext.apply({}, {
\r
48 batchTransactions: false
\r
50 Ext.data.DirectStore.superclass.constructor.call(this, Ext.apply(c, {
\r
51 proxy: Ext.isDefined(c.proxy) ? c.proxy : new Ext.data.DirectProxy(Ext.copyTo({}, c, 'paramOrder,paramsAsHash,directFn,api')),
\r
52 reader: (!Ext.isDefined(c.reader) && c.fields) ? new Ext.data.JsonReader(Ext.copyTo({}, c, 'totalProperty,root,idProperty'), c.fields) : c.reader
\r
56 Ext.reg('directstore', Ext.data.DirectStore);