Check documentation for the latest version of dhtmlxSuite goToPrevTab DHTMLX Docs

goToPrevTab

selects the tab prev to the active one

void goToPrevTab();

Example

var myTabbar = new dhtmlXTabBar("parentId");
 
myTabbar.addTab("a1", "Rage");
myTabbar.addTab("a2", "Motorhead");
myTabbar.addTab("a3", "Poisonblack", null, null, true);
 
myTabbar.disableTab("a2");
// -> state: a1 - not selected, a2 - disabled not selected, a3 - selected
 
myTabbar.goToPrevTab();
// -> state: a1 - not selected, a2 - disabled selected, a3 - not selected
 
myTabbar.setTabInActive();
// -> state: a1 - not selected, a2 - disabled not selected, a3 - not selected
 
myTabbar.goToPrevTab();
// -> state: a1 - selected, a2 - disabled not selected, a3 - not selected

Details

skips hidden tabs; selects disabled tabs if any; selects the first tab, if no one selected; if the first tab selected, does nothing

Back to top