Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Digo on Apr 30, 2009 02:46
open dhtmlx forum
setTabActive?

Hi!

I´ve got a Tabbar with some tabs:

<div id="a_tabbar" class="dhtmlxTabBar" imgpath="dhtmlxTabbar/codebase/imgs/" style="width:750px; height:400px; overflow:hidden;" >
<div id="a1" width="100px" name="MyTab 1" >
<div id="a2" width="100px" name="MyTab 2" >

I have no idea, how to set Tab2 (a2) active via Script

I tried:

tabbar=new dhtmlXTabBar("a_tabbar","top");
tabbar.setTabActive("a2");

but this just creates a new tab.

Thanks!
Digo




Answer posted by Alex (support) on Apr 30, 2009 03:38

Hello, 

You can use one of the following approaches:

1) <div id="a_tabbar" oninit="doOnInit()"class="dhtmlxTabBar" imgpath="dhtmlxTabbar/codebase/imgs/" style="width:750px; height:400px; overflow:hidden;" >

function doOnInit(){

a_tabbar.setTabActive("a2");

}

2) <div id="a1" width="100px" name="MyTab 1"  selected="1">...</div>