3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.data.DirectStore"></div>/**
\r
15 * @class Ext.data.DirectStore
\r
16 * @extends Ext.data.Store
\r
17 * <p>Small helper class to create an {@link Ext.data.Store} configured with an
\r
18 * {@link Ext.data.DirectProxy} and {@link Ext.data.JsonReader} to make interacting
\r
19 * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier.
\r
20 * To create a different proxy/reader combination create a basic {@link Ext.data.Store}
\r
21 * configured as needed.</p>
\r
23 * <p><b>*Note:</b> Although they are not listed, this class inherits all of the config options of:</p>
\r
24 * <div><ul class="mdetail-params">
\r
25 * <li><b>{@link Ext.data.Store Store}</b></li>
\r
26 * <div class="sub-desc"><ul class="mdetail-params">
\r
29 * <li><b>{@link Ext.data.JsonReader JsonReader}</b></li>
\r
30 * <div class="sub-desc"><ul class="mdetail-params">
\r
31 * <li><tt><b>{@link Ext.data.JsonReader#root root}</b></tt></li>
\r
32 * <li><tt><b>{@link Ext.data.JsonReader#idProperty idProperty}</b></tt></li>
\r
33 * <li><tt><b>{@link Ext.data.JsonReader#totalProperty totalProperty}</b></tt></li>
\r
36 * <li><b>{@link Ext.data.DirectProxy DirectProxy}</b></li>
\r
37 * <div class="sub-desc"><ul class="mdetail-params">
\r
38 * <li><tt><b>{@link Ext.data.DirectProxy#directFn directFn}</b></tt></li>
\r
39 * <li><tt><b>{@link Ext.data.DirectProxy#paramOrder paramOrder}</b></tt></li>
\r
40 * <li><tt><b>{@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}</b></tt></li>
\r
44 * @xtype directstore
\r
47 * @param {Object} config
\r
49 Ext.data.DirectStore = function(c){
\r
50 // each transaction upon a singe record will generatie a distinct Direct transaction since Direct queues them into one Ajax request.
\r
51 c.batchTransactions = false;
\r
53 Ext.data.DirectStore.superclass.constructor.call(this, Ext.apply(c, {
\r
54 proxy: (typeof(c.proxy) == 'undefined') ? new Ext.data.DirectProxy(Ext.copyTo({}, c, 'paramOrder,paramsAsHash,directFn,api')) : c.proxy,
\r
55 reader: (typeof(c.reader) == 'undefined' && typeof(c.fields) == 'object') ? new Ext.data.JsonReader(Ext.copyTo({}, c, 'totalProperty,root,idProperty'), c.fields) : c.reader
\r
58 Ext.extend(Ext.data.DirectStore, Ext.data.Store, {});
\r
59 Ext.reg('directstore', Ext.data.DirectStore);