I have to edit data inside my template that is use for Ext.Panel. How can I do this ? I tried to add listener, but click event did not bind click to that panel.
Ext.XTemplate:
MyApp.ext.MyExtension.prototype.mytpl = new Ext.XTemplate(
'<tpl for=".">',
'<table class="my">',
'<tr><th>Item:</th><td>{itemIWantToEdit}</td></tr>',
'</table>',
'</tpl>'
).compile();
Ext.Panel:
var myPanel = new Ext.Panel({
xtype: 'panel',
region: 'east',
title: 'MyPanel',
开发者_StackOverflow社区 split: true,
width: 220,
collapsible: true,
layout: 'fit'
// etc...
Looking at the tpl implementation in Ext.Panel you should be able to alter the tpl of an existing Panel by just overwriting the tpl property with a new XTemplate instance.
// Create panel
var myPanel = new Ext.Panel(...);
// Later, somewhere else, in a listener for example
myPanel.tpl = new Ext.XTemplate('<tpl for="."> ... </tpl>');
精彩评论