开发者

Editing data inside Ext.XTemplate which is inside Ext.Panel

开发者 https://www.devze.com 2023-02-17 02:20 出处:网络
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.

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>');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号