X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2FTemplate.js;fp=Roo%2FTemplate.js;h=8d21e6bd1d52875abdb26279c942d3d81f0b0977;hp=4f8e30281afe8a961bae09bb01001ee20415f749;hb=7c1aff78f2ad6593b61c937754377a4028320c94;hpb=803b23a22f2f471c1d444f1b7c888271ec0a7918 diff --git a/Roo/Template.js b/Roo/Template.js index 4f8e30281a..8d21e6bd1d 100644 --- a/Roo/Template.js +++ b/Roo/Template.js @@ -53,6 +53,12 @@ Roo.Template = function(cfg){ }; Roo.Template.prototype = { + /** + * @cfg {Function} onLoad Called after the template has been loaded and complied (usually from a remove source) + */ + onLoad : false, + + /** * @cfg {String} url The Url to load the template from. beware if you are loading from a url, the data may not be ready if you use it instantly.. * it should be fixed so that template is observable... @@ -130,6 +136,9 @@ Roo.Template.prototype = { _t.html = response.responseText; _t.url = false; _t.compile(); + if (_t.onLoad) { + _t.onload(); + } }, failure : function(response) { Roo.log("Template failed to load from " + _t.url);