Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Steven Lichtenberg on Apr 29, 2008 10:29
open dhtmlx forum
I need to programatically set attributes of each tab

http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=3049

in reference to the above question, the setTabActive syntax is correct.  This is a text substitution trick with the back end programs/database access routines.  I pass the value of the tab Id from the database.

Second, I got the setOnSelectHandler() to work in that the handler is firing.  Now I need to programatically set attributes of each tab.  What is the syntax to get the current tab?  I am getting the tab clicked passed to the handler but before I move, I need to submit the form that is embedded in the current tab and change the tab header.

I tried  test=document.getElementById('a_tabbar');
    test.setLabel(''Complete');
but I am getting setLabel is not a function errors.
Answer posted by Support on Apr 30, 2008 01:36
a) you need not use getElementById to access tabbar. Tabbar object and container div which was used for tabbar initialization are different entities
b) You can get current active tab as
    a_tabbar.getActiveTab(

    var id=a_tabbar.getActiveTab();
    a_tabbar.setLabel(id,"Complete");
Answer posted by koosvdkolk on May 07, 2008 01:44

But how can I refer to a tab when it is not active? I have multiple tabs, each communicating with the database using Ajax (every 5 seconds a request is made). Based on data in database, I want to change the caption of the tab. E.g. I use the tabbar for multiple chat windows. These windows check for new messages in the database. When a new message arrives in one of the windows, the corresponding tab caption should change to: 'new message'.

Answer posted by Support on May 08, 2008 03:56
>>But how can I refer to a tab when it is not active?
Basically you need to set tab to active state, the getActiveTab used only to get tab's ID; in real app you will probably know the IDs of all tabs.
And of course you can use setLabel against not active tab.