roojs-core.js
authorAlan Knowles <alan@roojs.com>
Mon, 6 Feb 2017 05:05:58 +0000 (13:05 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 6 Feb 2017 05:05:58 +0000 (13:05 +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 9f4c1f0..b99c7ad 100644 (file)
@@ -1046,7 +1046,7 @@ this.selections.push(E);if(!C){this.fireEvent("selectionchange",this,this.select
 Roo.JsonView=function(A,B,C){Roo.JsonView.superclass.constructor.call(this,A,B,C);var um=this.el.getUpdateManager();um.setRenderer(this);um.on("update",this.onLoad,this);um.on("failure",this.onLoadException,this);this.addEvents({'beforerender':true,'load':true,'loadexception':true}
 );};Roo.extend(Roo.JsonView,Roo.View,{jsonRoot:"",refresh:function(){this.clearSelections();this.el.update("");var A=[];var o=this.jsonData;if(o&&o.length>0){for(var i=0,B=o.length;i<B;i++){var C=this.prepareData(o[i],i,o);A[A.length]=this.tpl.apply(C);}}
 else{A.push(this.emptyText);}this.el.update(A.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0);},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);},render:function(el,A){this.clearSelections();this.el.update("");
-var o;try{o=Roo.util.JSON.decode(A.responseText);if(this.jsonRoot){o=o[this.jsonRoot];}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(A){if(A instanceof Array){var B=[];
+var o;try{if(A!=''){o=Roo.util.JSON.decode(A.responseText);if(this.jsonRoot){o=o[this.jsonRoot];}}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(A){if(A instanceof Array){var B=[];
 for(var i=0,C=A.length;i<C;i++){B.push(this.getNodeData(A[i]));}return B;}return this.jsonData[this.indexOf(A)]||null;},beforeRender:function(){this.snapshot=this.jsonData;if(this.sortInfo){this.sort.apply(this,this.sortInfo);}this.fireEvent("beforerender",this,this.jsonData);
 },onLoad:function(el,o){this.fireEvent("load",this,this.jsonData,o);},onLoadException:function(el,o){this.fireEvent("loadexception",this,o);},filter:function(A,B){if(this.jsonData){var C=[];var ss=this.snapshot;if(typeof B=="string"){var D=B.length;if(D==0){this.clearFilter();
 return;}B=B.toLowerCase();for(var i=0,E=ss.length;i<E;i++){var o=ss[i];if(o[A].substr(0,D).toLowerCase()==B){C.push(o);}}}else if(B.exec){for(var i=0,E=ss.length;i<E;i++){var o=ss[i];if(B.test(o[A])){C.push(o);}}}else{return;}this.jsonData=C;this.refresh();
index 219f737..21624b2 100644 (file)
@@ -27035,15 +27035,20 @@ Roo.extend(Roo.JsonView, Roo.View, {
         um.update.apply(um, arguments);
     },
 
+    // note - render is a standard framework call...
+    // using it for the response is really flaky... - it's called by UpdateManager normally, except when called by the XComponent/addXtype.
     render : function(el, response){
+        
         this.clearSelections();
         this.el.update("");
         var o;
         try{
-            o = Roo.util.JSON.decode(response.responseText);
-            if(this.jsonRoot){
-                
-                o = o[this.jsonRoot];
+            if (response != '') {
+                o = Roo.util.JSON.decode(response.responseText);
+                if(this.jsonRoot){
+                    
+                    o = o[this.jsonRoot];
+                }
             }
         } catch(e){
         }
index aaa06b7..2ae0fbd 100644 (file)
@@ -9228,15 +9228,20 @@ Roo.extend(Roo.JsonView, Roo.View, {
         um.update.apply(um, arguments);
     },
 
+    // note - render is a standard framework call...
+    // using it for the response is really flaky... - it's called by UpdateManager normally, except when called by the XComponent/addXtype.
     render : function(el, response){
+        
         this.clearSelections();
         this.el.update("");
         var o;
         try{
-            o = Roo.util.JSON.decode(response.responseText);
-            if(this.jsonRoot){
-                
-                o = o[this.jsonRoot];
+            if (response != '') {
+                o = Roo.util.JSON.decode(response.responseText);
+                if(this.jsonRoot){
+                    
+                    o = o[this.jsonRoot];
+                }
             }
         } catch(e){
         }
index d2b7337..8495831 100644 (file)
@@ -318,7 +318,7 @@ this.selections.push(E);if(!C){this.fireEvent("selectionchange",this,this.select
 Roo.JsonView=function(A,B,C){Roo.JsonView.superclass.constructor.call(this,A,B,C);var um=this.el.getUpdateManager();um.setRenderer(this);um.on("update",this.onLoad,this);um.on("failure",this.onLoadException,this);this.addEvents({'beforerender':true,'load':true,'loadexception':true}
 );};Roo.extend(Roo.JsonView,Roo.View,{jsonRoot:"",refresh:function(){this.clearSelections();this.el.update("");var A=[];var o=this.jsonData;if(o&&o.length>0){for(var i=0,B=o.length;i<B;i++){var C=this.prepareData(o[i],i,o);A[A.length]=this.tpl.apply(C);}}
 else{A.push(this.emptyText);}this.el.update(A.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0);},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);},render:function(el,A){this.clearSelections();this.el.update("");
-var o;try{o=Roo.util.JSON.decode(A.responseText);if(this.jsonRoot){o=o[this.jsonRoot];}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(A){if(A instanceof Array){var B=[];
+var o;try{if(A!=''){o=Roo.util.JSON.decode(A.responseText);if(this.jsonRoot){o=o[this.jsonRoot];}}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(A){if(A instanceof Array){var B=[];
 for(var i=0,C=A.length;i<C;i++){B.push(this.getNodeData(A[i]));}return B;}return this.jsonData[this.indexOf(A)]||null;},beforeRender:function(){this.snapshot=this.jsonData;if(this.sortInfo){this.sort.apply(this,this.sortInfo);}this.fireEvent("beforerender",this,this.jsonData);
 },onLoad:function(el,o){this.fireEvent("load",this,this.jsonData,o);},onLoadException:function(el,o){this.fireEvent("loadexception",this,o);},filter:function(A,B){if(this.jsonData){var C=[];var ss=this.snapshot;if(typeof B=="string"){var D=B.length;if(D==0){this.clearFilter();
 return;}B=B.toLowerCase();for(var i=0,E=ss.length;i<E;i++){var o=ss[i];if(o[A].substr(0,D).toLowerCase()==B){C.push(o);}}}else if(B.exec){for(var i=0,E=ss.length;i<E;i++){var o=ss[i];if(B.test(o[A])){C.push(o);}}}else{return;}this.jsonData=C;this.refresh();