]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - 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"}
4 * Designed to work with the KeyValue model and the JsonObject data reader
6 Ext
.define('Proxmox.data.ObjectStore', {
7 extend
: 'Proxmox.data.UpdateStore',
9 getRecord: function() {
11 var record
= Ext
.create('Ext.data.Model');
12 me
.getData().each(function(item
) {
13 record
.set(item
.data
.key
, item
.data
.value
);
19 constructor: function(config
) {
22 config
= config
|| {};
24 if (!config
.storeid
) {
25 config
.storeid
= 'proxmox-store-' + (++Ext
.idSeed
);
33 extraParams
: config
.extraParams
,
37 readArray
: config
.readArray
,
38 rootProperty
: config
.root
|| 'data'
43 me
.callParent([config
]);