简体   繁体   中英

Setting active tab current tab

I have three tabs that i'm setting active, due to a certain functionality, the last active tab might not be the one the user on. So at the end of this 3 line code i'm trying to set active the tab that the user is on:

tabPanel.setActiveTab(1);
  tabPanel.setActiveTab(2);
  tabPanel.setActiveTab(0);

I want to set the current tab the tab that the user is on, (the active tab). Any help on this?

You can do something like this:

var currentTab = tabPanel.getActiveTab();

tabPanel.setActiveTab(0);
tabPanel.setActiveTab(1);
tabPanel.setActiveTab(2);

tabPanel.setActiveTab(currentTab);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM