PDA

View Full Version : render Ext.template object onto a panel



mxu
29 Nov 2007, 10:42 AM
hi,

var divID = 'someID';
var t = new Ext.Template(
...
);
var c ={};

Ext.Ajax.request ({
url: tURL,
params: {},
method: 'GET',
success: function (result, request) {
c = eval ('('+result.responseText+')');
t.append (divID, c);
});

i can simply do panel.body.innerHtml = t but js is not evauated at the panel.
how can I render t onto a panel while getting js is evaluated?

29 Nov 2007, 12:16 PM
if the panel is not rendered, set the template data as an 'html' attribute for the panel.

mxu
29 Nov 2007, 2:47 PM
but js is not activated, how can make js in the html evaluated ?

29 Nov 2007, 3:24 PM
why would you embed javascript in a template. that's not the best way to go about things.