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