IT:AD:Sencha Touch:Reference:HowTo:Working with Panel Tabs
#### Define A Tab ####
Done with Maps (Warning: Markdown Munging):
{ title: tabTitle, iconCls: 'tabs', autoLoad: {url: targetUrl, callback: this.initSearch, scope: this}, closable:true }
#### Get Panel ####
var tab = tabPanel.getAt(tabId); if(!tab){ tab = addTab(tabSchemaMap); }
#### Adding A Panel ####
oPanel.add(tabSchemaMap};
#### Showing A Panel ####
oPanel.show();
### Get Active Tab ###
var activeTav = tabPanel.getActiveTab();
#### Show Tab ####
By Index:
var tab = tabPanel.getAt(3); //Didn't work: //tabPanel.setCard(tab); //Did work: tabPanel.setActiveItem(tav);
By Name:
function setActiveTabByTitle( tabTitle ) { var tabs = myTabPanel.find( 'title', tabTitle ); myTabPanel.setActiveTab( tabs[ 0 ] ); }
##
Gotchas
Stupid, but still: make sure you are building a TabPanel, not Panel :
Ext.create("Ext.TabPanel", { fullscreen : true, items : [ mainPanel,contentPanel, statisticsPanel ] }).setActiveItem(0);