PDA

View Full Version : XTemplate and Custom Component (radiogroup)



gocsp11
23 Jan 2011, 2:15 PM
Hello guys,

i'm trying to create a custom component (a radiogroup), but i have big problems with the template.

At first i extend from Ext.form.Field for the component and set the items (radiofields without label).
Then i tried to build the template in the initComponent method (assign at this.renderTpl)
i looked at the api and found this:


var tpl = new Ext.XTemplate(
'<p>Kids: ',
'<tpl for=".">', // process the data.kids node
'<p>{#}. {name}</p>', // use current array index to autonumber
'</tpl></p>'
);
tpl.overwrite(panel.body, data.kids);


here, i dont know what panel.body (instead i tried Ext.getBody()) and the for-loop doesnt work. i tried a lot of different steps, but nothing worked for me. How i can use the for-loop with the items in the template?

Thank for help.