Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dasu on Feb 20, 2009 10:01
open dhtmlx forum
How to get a handle to tabbar in one layoutcell from a page in a sibling cell.

I have the following configuration

layout [
cell-a -> tabbar1 ->Tab1
Tab2

cell-b -> tabbar2 -> Tab3
-> Tab4
]

I want a click event in Tab1 -> to load a new URL to Tab4 (cell B)
I am not sure how to access the handle to tabbar2 within the html page context of Tab1
I am using href context for loading pages via CGI in all instances.
I looked through the Knowldge base - without any match to this problem

The real question is :
Once you create Tabset within a layout in one cell - how do you get a handle to the tabbar from the "other cell" ?
Answer posted by Support on Feb 23, 2009 08:57
If you are loading data by AJAX or as DOM elements, all objects will be part of the same document, so you can directly use object references received during creation. 
If you are using URL based approach - each elements will be a separate iframe, so you can use "top." to get context to the top level and start from there

top.dhxLayout.cells("a")._frame.contentWindow.tabbar2.forceLoad("tab3",url)

dhxLayout and tabbar2 - names of objects of layout and second tabbar
Answer posted by Alex (support) on Feb 23, 2009 09:07

If you use iframe-based loading mode for tabbar1, the pages (tab1 and tab2) are inside iframes. So, in order to operate with objects of parent window you can use something as follows:

parent.tabbar2.setContentHref("tab4","some.html");