Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Rolf on Mar 10, 2008 11:30
open dhtmlx forum
Activate DHTMLX Tabbar by 'ID'

Hi there,

Some time ago I asked the following question: http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=2008&a=2423
I received an answer (thanks) which was suitable for Firefox. In Internet Explorer use a different way to load the tabs.

The code is as follows:

 <link rel='STYLESHEET' type='text/css' href='../common/style.css!'>
     <table>
         <tr>
             <td> <div id=a_tabbar style=\"width:512px; height:600px;\"/></td>
   </tr>
  </table>
        <script>
   tabbar=new dhtmlXTabBar(\"a_tabbar\",\"top\");
            tabbar.setImagePath(\"includes/dhtmlxTabbar/codebase/imgs/\");
            tabbar.loadXML(\"includes/tabs_xml_property.php?cid=$_SESSION[companycode]&uid=$_SESSION[userid]&cms_l=$cms_l&propertyid=$propertyid\");
   tabbar.setSkinColors(\"#FAFCFE\",\"#FFFACD\");
  </script>

The issue is that when I use this way (XML) for loading the tabs, the following code does NOT work for activating a certain tab by name.

<a href="#" onClick="a_tabbar.setTabActive('b7')"><img src="../tabshortcut_statistics.gif" name="tabshortcut_statistics" width="27" height="26" border="0"></a>

Any ideas?

Answer posted by Support on Mar 11, 2008 04:17
In the code provided above you are using
     tabbar=new dhtmlXTabBar
and later
    a_tabbar.setTabActive('b7')
so you are using different name for the same object, the correct code would be
    tabbar.setTabActive('b7')

( the ID of container can be used as a name in case of init from HTML, in case of init by javascript - you need to use name of var in which object reference stored )