Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by koosvdkolk on May 06, 2008 06:01
open dhtmlx forum
[tabbar] how to get parent tab Id from iframe document?

I have a tabbar with several tabs. Each tab contains a iFrame with a HTML page on it.

My question: from such a HTML page, how can I get the id of the parent tab?

In other words:

[tabbar]
[tab, id=tab1]
[html page] --> how can this page know the id of the parent tab (tab1)?
[tab, id=tab2]
[html page]
[tab, id=tab3]
[html page]

Answer posted by Support on May 07, 2008 02:54
There is no stable solution for such use-case ( the content page doesn't have any info about related tab ID ), but you can try to use next code

function get_tab_id(){
    var tabbar = top.tabbar;
    for (var id in tabbar.tabsId)
       if (tabbar.tabWindow(id) == window )
          return id;
    return null;
}
Answer posted by koosvdkolk on May 07, 2008 02:59
thanks!

My solution was to put the tabId in the URL of the iFrame, which works as well.