Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the active tab index in tab panel?

How can I get the active or selected tab index in tab panel in sencha touch?

I am using tabpanel in my application.

like image 555
user386430 Avatar asked Oct 14 '15 17:10

user386430


3 Answers

var tabpanel = Ext.ComponentQuery.query('mainViewport #mainTabPanel'); //use your item Id / reference here
var activeTab = tabpanel.getActiveTab();
var activeTabIndex = tabpanel.items.indexOf(activeTab);
like image 136
Mohit Saxena Avatar answered Nov 20 '22 14:11

Mohit Saxena


I had to use:

tabpanel.getActiveItem();

Was getting this error on getActiveTab:

getActiveTab is not a function

like image 43
IAmCoder Avatar answered Nov 20 '22 14:11

IAmCoder


var activeTab = tabPanel.getActiveTab();
var currentStep = tabPanel.items.indexOf(activeTab);
like image 3
RMarts Avatar answered Nov 20 '22 16:11

RMarts