]> git.proxmox.com Git - proxmox-widget-toolkit.git/blob - data/ObjectStore.js
1e3771f6d7b62a1d7379af3f2e51065c41674989
[proxmox-widget-toolkit.git] / data / ObjectStore.js
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 */
6 Ext.define('Proxmox.data.ObjectStore', {
7 extend: 'Proxmox.data.UpdateStore',
8
9 constructor: function(config) {
10 var me = this;
11
12 config = config || {};
13
14 if (!config.storeid) {
15 config.storeid = 'proxmox-store-' + (++Ext.idSeed);
16 }
17
18 Ext.applyIf(config, {
19 model: 'KeyValue',
20 proxy: {
21 type: 'proxmox',
22 url: config.url,
23 extraParams: config.extraParams,
24 reader: {
25 type: 'jsonobject',
26 rows: config.rows,
27 readArray: config.readArray,
28 rootProperty: config.root || 'data'
29 }
30 }
31 });
32
33 me.callParent([config]);
34 }
35 });