Commit 2f69c0ba authored by Emmanuel Kasper's avatar Emmanuel Kasper Committed by Dietmar Maurer

ext5migrate: replace call to private ExtJS function getRoot()

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.
parent b24be272
......@@ -24,7 +24,8 @@ Ext.define('PVE.data.ObjectStore', {
reader: {
type: 'jsonobject',
rows: config.rows,
readArray: config.readArray
readArray: config.readArray,
rootProperty: config.root || 'data'
}
}
});
......
......@@ -31,8 +31,6 @@ Ext.define('PVE.data.reader.JsonObject', {
extend: 'Ext.data.reader.Json',
alias : 'reader.jsonobject',
root: 'data',
readArray: false,
rows: undefined,
......@@ -50,8 +48,9 @@ Ext.define('PVE.data.reader.JsonObject', {
var data = [];
try {
var result = Ext.decode(response.responseText);
var root = me.getRoot(result);
var result = Ext.decode(response.responseText);
// get our data items inside the server response
var root = result[me.getRootProperty()];
if (me.readArray) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment