From 86a6ec31d8daf8cc737d3b7c51af90eb803e9886 Mon Sep 17 00:00:00 2001 From: john Date: Fri, 11 May 2018 11:51:50 +0800 Subject: [PATCH] Roo/data/JsonReader.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/data/JsonReader.js | 4 ++++ roojs-bootstrap-debug.js | 10 ++++------ roojs-bootstrap.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Roo/data/JsonReader.js b/Roo/data/JsonReader.js index 361b361ecc..2e36b77dcf 100644 --- a/Roo/data/JsonReader.js +++ b/Roo/data/JsonReader.js @@ -141,6 +141,10 @@ Roo.extend(Roo.data.JsonReader, Roo.data.DataReader, { * @type Object */ this.o = o; + + Roo.log('------------------'); + Roo.log(o); + var s = this.meta, Record = this.recordType, f = Record ? Record.prototype.fields : null, fi = f ? f.items : [], fl = f ? f.length : 0; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 5df01649e5..d8e0aea0be 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -12268,15 +12268,13 @@ Roo.extend(Roo.data.JsonReader, Roo.data.DataReader, { * @type Object */ this.o = o; + + Roo.log('------------------'); + Roo.log(o); + var s = this.meta, Record = this.recordType, f = Record ? Record.prototype.fields : null, fi = f ? f.items : [], fl = f ? f.length : 0; - Roo.log('----------------------'); - Roo.log(s); - Roo.log(Record); - Roo.log(f); - - // Generate extraction functions for the totalProperty, the root, the id, and for each field if (!this.ef) { if(s.totalProperty) { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 8a98fad811..d53f74adae 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -491,7 +491,7 @@ A.callback.call(A.scope||window,B,A.arg,true);},handleFailure:function(A){this.t Roo.data.JsonReader=function(A,B){A=A||{};Roo.applyIf(A,{totalProperty:'total',successProperty:'success',root:'data',id:'id'});Roo.data.JsonReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.JsonReader,Roo.data.DataReader,{metaFromRemote:false,read:function(A){var B=A.responseText; var o=eval("("+B+")");if(!o){throw {message:"JsonReader.read: Json object not found"};}if(o.metaData){delete this.ef;this.metaFromRemote=true;this.meta=o.metaData;this.recordType=Roo.data.Record.create(o.metaData.fields);this.onMetaChange(this.meta,this.recordType,o); }return this.readRecords(o);},onMetaChange:function(A,B,o){},simpleAccess:function(A,B){return A[B];},getJsonAccessor:function(){var re=/[\[\.]/;return function(A){try{return (re.test(A))?new Function("obj","return obj."+A):function(B){return B[A];};}catch(e){} -return Roo.emptyFn;};}(),readRecords:function(o){this.o=o;var s=this.meta,A=this.recordType,f=A?A.prototype.fields:null,fi=f?f.items:[],fl=f?f.length:0;Roo.log('----------------------');Roo.log(s);Roo.log(A);Roo.log(f);if(!this.ef){if(s.totalProperty){this.getTotal=this.getJsonAccessor(s.totalProperty); +return Roo.emptyFn;};}(),readRecords:function(o){this.o=o;Roo.log('------------------');Roo.log(o);var s=this.meta,A=this.recordType,f=A?A.prototype.fields:null,fi=f?f.items:[],fl=f?f.length:0;if(!this.ef){if(s.totalProperty){this.getTotal=this.getJsonAccessor(s.totalProperty); }if(s.successProperty){this.getSuccess=this.getJsonAccessor(s.successProperty);}this.getRoot=s.root?this.getJsonAccessor(s.root):function(p){return p;};if(s.id){var g=this.getJsonAccessor(s.id);this.getId=function(I){var r=g(I);return (r===undefined||r==="")?null:r; };}else{this.getId=function(){return null;};}this.ef=[];for(var jj=0;jj