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,
......@@ -51,7 +49,8 @@ Ext.define('PVE.data.reader.JsonObject', {
var data = [];
try {
var result = Ext.decode(response.responseText);
var root = me.getRoot(result);
// 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