I have a TabPanel like this:
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.create('Ext.TabPanel', {
items: [
{
title: "",
reference: 'tabpanel',
itemId: 'tab1',
items: [{
itemId: 'firstTab',
xclass: 'viewClass'
}],
}, {
title: "",
reference: 'tab2',
layout: 'fit',
items: [{
xclass: "view",
}]
}
]
in the xclass component there is the path of a class where is defined the view. In the view should be a button, after tap on it, the view should refresh and show another class, for example the view should be defined by 'viewClass2' and not anymore by 'viewClass' I'm imaging a function triggered on button tap like this:
Ext.getCmp('tab1').remove('firstTab');
Ext.getCmp('tab1').add({
itemId: 'firstTab',
xclass: 'viewClass2'
})
BUT I must use itemId
and not id
so I cannot use "Ext.getCmp
" and i should use Ext.Component.query
but I don't know how to manage remove and add operations