X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FTemplate.js;h=f117c9aa6d6429a9a686bee198e80758b448ceda;hb=HEAD;hp=586a7de176f5c3353911dd9c3dab5e837a9499e3;hpb=960d50c92006ef3fcd1c47eb3e521591ed9319e1;p=roojs1 diff --git a/Roo/Template.js b/Roo/Template.js index 586a7de176..f117c9aa6d 100644 --- a/Roo/Template.js +++ b/Roo/Template.js @@ -68,11 +68,18 @@ Roo.Template.prototype = { * @cfg {String} html The HTML fragment or an array of fragments to join("") or multiple arguments to join("") */ html : '', + + + compiled : false, + loaded : false, /** * Returns an HTML fragment of this template with the specified values applied. * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) * @return {String} The HTML fragment */ + + + applyTemplate : function(values){ //Roo.log(["applyTemplate", values]); try { @@ -133,9 +140,10 @@ Roo.Template.prototype = { method : 'GET', success : function (response) { _t.loading = false; - _t.html = response.responseText; _t.url = false; - _t.compile(); + + _t.set(response.responseText,true); + _t.loaded = true; if (_t.onLoad) { _t.onLoad(); } @@ -155,7 +163,7 @@ Roo.Template.prototype = { */ set : function(html, compile){ this.html = html; - this.compiled = null; + this.compiled = false; if(compile){ this.compile(); }