Roo/Template.js
[roojs1] / Roo / Template.js
index 73f962b..2f1e80f 100644 (file)
@@ -105,12 +105,20 @@ Roo.Template.prototype = {
         if (this.loading) {
             return;
         }
-        var cx = new Roo.data.Connection({
+        this.loading = true;
+        var _t = this;
+        var cx = new Roo.data.Connection();
+        cx.request({
             url : url,
             method : 'GET',
-            success : success,
-            failure : function() {
-                Roo.log("Template failed to load from " + url);  
+            success : function (response) {
+                _t.loading = false;
+                _t.html = response.responseText;
+                success && success();
+            },
+            failure : function(response) {
+                Roo.log("Template failed to load from " + url);
+                _t.loading = false;
             }
         });
     },