]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Small helper class to create an {@link Ext.data.Store} configured with an {@link Ext.data.proxy.Direct}\r | |
3 | * and {@link Ext.data.reader.Json} to make interacting with an {@link Ext.direct.Manager} server-side\r | |
4 | * {@link Ext.direct.Provider Provider} easier. To create a different proxy/reader combination create a basic\r | |
5 | * {@link Ext.data.Store} configured as needed.\r | |
6 | *\r | |
7 | * **Note:** Although they are not listed, this class inherits all of the config options of:\r | |
8 | *\r | |
9 | * - **{@link Ext.data.Store Store}**\r | |
10 | *\r | |
11 | * - **{@link Ext.data.reader.Json JsonReader}**\r | |
12 | *\r | |
13 | * - **{@link Ext.data.reader.Json#cfg-rootProperty rootProperty}**\r | |
14 | * - **{@link Ext.data.reader.Json#totalProperty totalProperty}**\r | |
15 | *\r | |
16 | * - **{@link Ext.data.proxy.Direct DirectProxy}**\r | |
17 | *\r | |
18 | * - **{@link Ext.data.proxy.Direct#directFn directFn}**\r | |
19 | * - **{@link Ext.data.proxy.Direct#paramOrder paramOrder}**\r | |
20 | * - **{@link Ext.data.proxy.Direct#paramsAsHash paramsAsHash}**\r | |
21 | *\r | |
22 | */\r | |
23 | Ext.define('Ext.data.DirectStore', {\r | |
24 | /* Begin Definitions */\r | |
25 | \r | |
26 | extend: 'Ext.data.Store',\r | |
27 | \r | |
28 | alias: 'store.direct',\r | |
29 | \r | |
30 | requires: ['Ext.data.proxy.Direct'],\r | |
31 | \r | |
32 | /* End Definitions */\r | |
33 | \r | |
34 | constructor : function(config){\r | |
35 | config = Ext.apply({}, config);\r | |
36 | if (!config.proxy) {\r | |
37 | var proxy = {\r | |
38 | type: 'direct',\r | |
39 | reader: {\r | |
40 | type: 'json'\r | |
41 | }\r | |
42 | };\r | |
43 | Ext.copyTo(proxy, config, 'paramOrder,paramsAsHash,directFn,api,simpleSortMode,extraParams');\r | |
44 | Ext.copyTo(proxy.reader, config, 'totalProperty,root,rootProperty,idProperty');\r | |
45 | config.proxy = proxy;\r | |
46 | }\r | |
47 | this.callParent([config]);\r | |
48 | } \r | |
49 | });\r |