]>
Commit | Line | Data |
---|---|---|
1ee7afe5 EK |
1 | /* This store encapsulates data items which are organized as an Array of key-values Objects |
2 | * ie data[0] contains something like {key: "keyboard", value: "da"} | |
3 | * | |
4 | * Designed to work with the KeyValue model and the JsonObject data reader | |
5 | */ | |
ff6260d6 | 6 | Ext.define('PVE.data.ObjectStore', { |
0c7c0d6b | 7 | extend: 'Proxmox.data.UpdateStore', |
ff6260d6 DM |
8 | |
9 | constructor: function(config) { | |
10 | var me = this; | |
11 | ||
12 | config = config || {}; | |
13 | ||
14 | if (!config.storeid) { | |
15 | config.storeid = 'pve-store-' + (++Ext.idSeed); | |
16 | } | |
17 | ||
18 | Ext.applyIf(config, { | |
19 | model: 'KeyValue', | |
20 | proxy: { | |
21 | type: 'pve', | |
22 | url: config.url, | |
23 | extraParams: config.extraParams, | |
24 | reader: { | |
25 | type: 'jsonobject', | |
26 | rows: config.rows, | |
5997aeca EK |
27 | readArray: config.readArray, |
28 | rootProperty: config.root || 'data' | |
ff6260d6 DM |
29 | } |
30 | } | |
31 | }); | |
32 | ||
33 | me.callParent([config]); | |
34 | } | |
35 | }); |