X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FJsonView.js;h=4d9513c4b8302ed88dc65b99d08bc42466d713b7;hb=75cbc4ce04c9c01ac47671cb01320ce699128d00;hp=ee1d8329cfd06a3576532eff971960f59f503a25;hpb=ed5f0e6e6228e78f28086ce21d017718a2b18d92;p=roojs1 diff --git a/Roo/JsonView.js b/Roo/JsonView.js index ee1d8329cf..4d9513c4b8 100644 --- a/Roo/JsonView.js +++ b/Roo/JsonView.js @@ -16,7 +16,7 @@

 var view = new Roo.JsonView({
     container: "my-element",
-    template: '<div id="{id}">{foo} - {bar}</div>', // auto create template
+    tpl: '<div id="{id}">{foo} - {bar}</div>', // auto create template
     multiSelect: true, 
     jsonRoot: "data" 
 });
@@ -96,8 +96,7 @@ Roo.JsonView = function(config, depreciated_tpl, depreciated_config){
 };
 Roo.extend(Roo.JsonView, Roo.View, {
     /**
-     * 
-     * @cfg {String} The root property in the loaded JSON object that contains the data
+     * @type {String} The root property in the loaded JSON object that contains the data
      */
     jsonRoot : "",
 
@@ -149,15 +148,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 = /** eval:var:o */ eval("o." + this.jsonRoot);
+            if (response != '') {
+                o = Roo.util.JSON.decode(response.responseText);
+                if(this.jsonRoot){
+                    
+                    o = o[this.jsonRoot];
+                }
             }
         } catch(e){
         }