X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..92c2b89db26be16707f4a805d3303ab2531006e1:/docs/source/ArrayReader.html?ds=inline diff --git a/docs/source/ArrayReader.html b/docs/source/ArrayReader.html index 16adff96..21593d88 100644 --- a/docs/source/ArrayReader.html +++ b/docs/source/ArrayReader.html @@ -1,5 +1,6 @@ + The source code @@ -56,27 +57,21 @@ Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { this.arrayData = o; var s = this.meta, sid = s ? Ext.num(s.idIndex, s.id) : null, - recordType = this.recordType, + recordType = this.recordType, fields = recordType.prototype.fields, records = [], + success = true, v; - if(!this.getRoot) { - this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p) {return p;}; - if(s.totalProperty) { - this.getTotal = this.getJsonAccessor(s.totalProperty); - } - } - var root = this.getRoot(o); - for(var i = 0; i < root.length; i++) { - var n = root[i]; - var values = {}; - var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); + for(var i = 0, len = root.length; i < len; i++) { + var n = root[i], + values = {}, + id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); for(var j = 0, jlen = fields.length; j < jlen; j++) { - var f = fields.items[j]; - var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; + var f = fields.items[j], + k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; v = n[k] !== undefined ? n[k] : f.defaultValue; v = f.convert(v, n); values[f.name] = v; @@ -94,8 +89,15 @@ Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { totalRecords = v; } } + if(s.successProperty){ + v = this.getSuccess(o); + if(v === false || v === 'false'){ + success = false; + } + } return { + success : success, records : records, totalRecords : totalRecords };