roojs-core.js
authorAlan Knowles <alan@roojs.com>
Mon, 30 Mar 2015 04:48:30 +0000 (12:48 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 30 Mar 2015 04:48:30 +0000 (12:48 +0800)
roojs-core-debug.js
roojs-ui.js
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index cccc0e7..485cc7a 100644 (file)
@@ -454,7 +454,7 @@ H.timeoutId=this.handleFailure.defer(this.timeout,this,[H]);var J=document.creat
 this.fireEvent("load",this,o,A.arg);A.callback.call(A.scope||window,B,A.arg,true);},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false);}});
 //Roo/data/JsonReader.js
 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.prototype.fields,fi=f.items,fl=f.length;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.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.json);return (r===undefined||r==="")?null:r;};}else {this.getId=function(){return null;};}
 this.ef=[];for(var jj=0;jj<fl;jj++){f=fi[jj];var B=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[jj]=this.getJsonAccessor(B);}}var C=this.getRoot(o),c=C.length,D=c,E=true;if(s.totalProperty){var vt=parseInt(this.getTotal(o),10);if(!isNaN(vt)){D=vt;}}if(s.successProperty){var vs=this.getSuccess(o);if(vs===false||vs==='false'){E=false;}}var F=[];for(var i=0;i<c;i++){var n=C[i];var G={};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;}
 G[f.name]=f.convert((v!==undefined)?v:f.defaultValue);}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};}});
 //Roo/data/XmlReader.js
index 17fab7c..221eb18 100644 (file)
@@ -22703,7 +22703,7 @@ Roo.extend(Roo.data.JsonReader, Roo.data.DataReader, {
                if (s.id) {
                        var g = this.getJsonAccessor(s.id);
                        this.getId = function(rec) {
-                               var r = g(rec);
+                               var r = g(rec.json); // used to be 'rec..'
                                return (r === undefined || r === "") ? null : r;
                        };
                } else {
index 3faabf8..ada6be2 100644 (file)
@@ -6278,7 +6278,7 @@ Roo.extend(Roo.data.JsonReader, Roo.data.DataReader, {
                if (s.id) {
                        var g = this.getJsonAccessor(s.id);
                        this.getId = function(rec) {
-                               var r = g(rec);
+                               var r = g(rec.json); // used to be 'rec..'
                                return (r === undefined || r === "") ? null : r;
                        };
                } else {
index 8e81413..473eba7 100644 (file)
@@ -120,7 +120,7 @@ H.timeoutId=this.handleFailure.defer(this.timeout,this,[H]);var J=document.creat
 this.fireEvent("load",this,o,A.arg);A.callback.call(A.scope||window,B,A.arg,true);},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false);}});
 //Roo/data/JsonReader.js
 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.prototype.fields,fi=f.items,fl=f.length;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.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.json);return (r===undefined||r==="")?null:r;};}else {this.getId=function(){return null;};}
 this.ef=[];for(var jj=0;jj<fl;jj++){f=fi[jj];var B=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[jj]=this.getJsonAccessor(B);}}var C=this.getRoot(o),c=C.length,D=c,E=true;if(s.totalProperty){var vt=parseInt(this.getTotal(o),10);if(!isNaN(vt)){D=vt;}}if(s.successProperty){var vs=this.getSuccess(o);if(vs===false||vs==='false'){E=false;}}var F=[];for(var i=0;i<c;i++){var n=C[i];var G={};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;}
 G[f.name]=f.convert((v!==undefined)?v:f.defaultValue);}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};}});
 //Roo/data/XmlReader.js