Check documentation for the latest version 6.0 of dhtmlxSuite forEachTab DHTMLX Docs

forEachTab

an iterator, calls a user-defined handler for each tab

void forEachTab(function handler);

Parameters

handlerfunctiona user-defined handler to call, tab object will be passed as a param

Example

var myTabbar = new dhtmlXTabBar("parentId");
 
// as an example - disable all tabs
myTabbar.forEachTab(function(tab){
    // your code here
    tab.disable();
    // to get id
    var id = tab.getId();
});
 
// the same in a different way
var ids = myTabbar.getAllTabs();
for (var q=0; q<ids.length; q++) {
    myTabbar.tabs(ids[q]).disable();
}

Details

can be useful when you need to perform the same operation for all tabs

function(tab){...} - here "tab" param is the same object which is returned by myTabbar.tabs(id)

Change log

added in version 4.0

Back to top