2014-05-02 37 views
0

我有一個tabpanel由Ext.container.ViewPort內部的以下代碼創建, 我該如何動態更改html?更改由xtype創建的tabpanel的HTML(Ext.js 4.2)

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

一種方式來做到這一點是例如: -

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'); 
... 
相關問題