From: Alan Knowles Date: Thu, 19 Aug 2021 04:27:29 +0000 (+0800) Subject: fix missing fields/meta data X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=84813c90759f58afaf090b74bee5847061a797fa fix missing fields/meta data --- diff --git a/docs/src/Roo_bootstrap_nav_Item.js.html b/docs/src/Roo_bootstrap_nav_Item.js.html index bf3e0c1e0e..830ef52907 100644 --- a/docs/src/Roo_bootstrap_nav_Item.js.html +++ b/docs/src/Roo_bootstrap_nav_Item.js.html @@ -197,9 +197,10 @@ if( this.preventDefault || - this.href == '#' + this.href === false || + this.href === '#' ){ - Roo.log("NavItem - prevent Default?"); + //Roo.log("NavItem - prevent Default?"); e.preventDefault(); } diff --git a/docs/src/Roo_data_JsonReader.js.html b/docs/src/Roo_data_JsonReader.js.html index 34bf3b4da3..fa572e75be 100644 --- a/docs/src/Roo_data_JsonReader.js.html +++ b/docs/src/Roo_data_JsonReader.js.html @@ -187,19 +187,27 @@ var myReader = new Roo.data.JsonReader({ } var records = []; for(var i = 0; i < c; i++){ - var n = root[i]; + var n = root[i]; var values = {}; var id = this.getId(n); for(var j = 0; j < fl; j++){ f = fi[j]; - var v = this.ef[j](n); - if (!f.convert) { - Roo.log('missing convert for ' + f.name); - Roo.log(f); - continue; - } - values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue); + var v = this.ef[j](n); + if (!f.convert) { + Roo.log('missing convert for ' + f.name); + Roo.log(f); + continue; + } + values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue); } + if (!Record) { + return { + raw : { errorMsg : "JSON Reader Error: fields or metadata not available to create Record" }, + success : false, + records : [], + totalRecords : 0 + }; + } var record = new Record(values, id); record.json = n; records[i] = record; diff --git a/roojs-all.js b/roojs-all.js index 4cadc9f99f..8ffd88e22f 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -998,7 +998,8 @@ return Roo.emptyFn;};}(),readRecords:function(o){this.o=o;var s=this.meta,A=this }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