我有一个由Ext.container.ViewPort中的以下代码创建的tabpanel, 如何动态更改html?
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title
id:'contentpanel',
activeTab: 0, // First tab active by default
items: {
title: 'Default Tab',
html: 'The first tab\'s content. Others may be added dynamically'
}
答案 0 :(得分:0)
这样做的一种方法是:
items: {
title: 'Default Tab',
itemId: 'tab1',
html: 'The first tab\'s content. Others may be added dynamically'
}
然后在一个事件中你可以使用:
更改标签的html...
Ext.ComponentQuery.query('#tab1')[0].setHtml('new content');
...