I have a store for a grid with an array-reader:
Code:
reader: new Ext.data.ArrayReader(
{ root: 'data',
totalProperty: 'total'
},
record),
And the server is sending this code:
({"total":"35","data":[["1","Name","Forename"],["2","Name2","Forename2"]]})
But no records are read into to store/grid. I traced it down to readRecords of ArrayReader:
Code:
readRecords : function(o) {
var sid = this.meta ? this.meta.id : null;
var recordType = this.recordType, fields = recordType.prototype.fields;
var records = [];
var root = o;
for ( var i = 0; i < root.length; i++) {
o is a object with o.total = 35 and o.data is the array of data.
So in root the data is expected, but the data is not in o, it's in o.data (which I said it would be there in the constructor of the ArrayReader).
It seems to me that there is no place in the code where the total-property or the root-property are taken care of. Doesn't ArrayReader work with a totalProperty and a root as said in the docs?