dj
26 May 2007, 5:37 AM
I'm lazy ;) so i would like to be able to pass Ext.Template's constructor a config-object that it would apply. So i could inject the required methods for the "this." syntax of the templates.
var tpl = new Ext.Template({
html:"<div>{data:this.test}</div>",
test:function(value){
return '~' + value + '~';
}
});
or html as array:
var tpl = new Ext.Template({
html:["<div>","{data:this.test}","</div>"],
test:function(value){
return '~' + value + '~';
}
});
while you are there, you could also add a "autoCompile" flag. If it is set the template would compile itself in the constructor.
var tpl = new Ext.Template({
html:"<div>{data:this.test}</div>",
test:function(value){
return '~' + value + '~';
}
});
or html as array:
var tpl = new Ext.Template({
html:["<div>","{data:this.test}","</div>"],
test:function(value){
return '~' + value + '~';
}
});
while you are there, you could also add a "autoCompile" flag. If it is set the template would compile itself in the constructor.