Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by adafos on Mar 05, 2008 07:06
open dhtmlx forum
Initialization from HTML and Hide/Show Tab

When initialize the tabbar with HTML how can you show or hide a tab.

When using js you have an object ex: tabbar=new dhtmlXTabBar("a_tabbar","top"); and you can show or hide with the api
tabbar.hideTab('b2',true)
tabbar.showTab('b2')
but in this case you know that the object is the tabbar so you can use the api.

In HTML:
<div id="a_tabbar" class="dhtmlxTabBar" imgpath="../../codebase/imgs/" style="width:390; height:390;" skinColors="#FCFBFC,#F4F3EE" >
<div id="a1" name="Profiles1">
<img src="../images/page_a.gif">
</div>
<div id="a2" name="Settings">
<img src="../images/page_b.gif">
</div>
<div id="a3" name="Content">
Content 3
</div>
</div>

which is the tabbar object in order to use the api. I can not use XML to draw the contents of tabs because are complicated forms so i think HMTL is easier, at least for me.

Is there any solution

Thanks in advnace
Answer posted by Support on Mar 05, 2008 08:22
There is no any attribute with necessary effect, but you can embed js command directly in HTML

<div id="a_tabbar" oninit=" a_tabbar.hideTab('a2'); " ....


Answer posted by adafos on Mar 06, 2008 00:44

this mean that if i want to init the tab using a select box i can use the onChange="javascript function" with which object.

I actually want to enable the tab when select an specific option on select box

 

Thanks in advance

Answer posted by Support on Mar 06, 2008 06:37
Sure, when div container converted to tabbar, global object created with same name as ID of container, so you can use it for later reference

    <select onchange=" a_tabbar.setTabActive(this.value); " ...