mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-06-06 04:32:29 +00:00

getRoot() semantics changed with ExtJS5. To avoid further annoyances when ExtJS6 is around the corner, replace the call to this private method, set rootProperty in the ObjectStore call, and use the value of rootProperty to filter out the content of the server answer.
36 lines
868 B
JavaScript
36 lines
868 B
JavaScript
/* This store encapsulates data items which are organized as an Array of key-values Objects
|
|
* ie data[0] contains something like {key: "keyboard", value: "da"}
|
|
*
|
|
* Designed to work with the KeyValue model and the JsonObject data reader
|
|
*/
|
|
Ext.define('PVE.data.ObjectStore', {
|
|
extend: 'PVE.data.UpdateStore',
|
|
|
|
constructor: function(config) {
|
|
var me = this;
|
|
|
|
config = config || {};
|
|
|
|
if (!config.storeid) {
|
|
config.storeid = 'pve-store-' + (++Ext.idSeed);
|
|
}
|
|
|
|
Ext.applyIf(config, {
|
|
model: 'KeyValue',
|
|
proxy: {
|
|
type: 'pve',
|
|
url: config.url,
|
|
extraParams: config.extraParams,
|
|
reader: {
|
|
type: 'jsonobject',
|
|
rows: config.rows,
|
|
readArray: config.readArray,
|
|
rootProperty: config.root || 'data'
|
|
}
|
|
}
|
|
});
|
|
|
|
me.callParent([config]);
|
|
}
|
|
});
|