Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by SM on Aug 13, 2009 03:23
open dhtmlx forum
Accessing Tabbar Objects

Hello,

i´m trying to acess Objects in a Tabbar.

I want to add a DIV to the Tabbar and later on fill the diff. The Tabbar is correctly displayed.
My Init Code:

var dhxtabbarB = dhxLayout40.cells("b").attachTabbar();
dhxtabbarB.addTab("mdxb1", "Test","100px");

How can I add the div to the Tabbar? I´m currently trying:


document.writeln("<div id=\"dropcontainer\">");
document.writeln("</div>");

dhxtabbarB.setContent("mdxb1", "dropcontainer");

dhxtabbarB.setContent("mdxb1", "<div id=\"dropcontainer\" height=\"100%\" width=\"100%\"></div>");
dhxtabbarB._cells(dhxWins,"mdxb1").attachObject("<div id=\"dropcontainer\" height=\"100%\" width=\"100%\"></div>");
dhxtabbarB.tabWindow("mdxb1").attachObject("<div id=\"dropcontainer\" height=\"100%\" width=\"100%\"></div>");


Later on I try to acess my DIV "dropcontainer" with:

document.getElementById("dropcontainer");
dhxtabbarB.tabWindow("mdxb1").
dhxtabbarB._cells(dhxWins,"mdxb1").
dhxtabbarB._cells(dhxWins,"mdxb1").getElementById("dropcontainer")

Nothing works. How can I acess the DIV "dropcontainer" and manipulate it?
Answer posted by Alex (support) on Aug 13, 2009 04:02

Hello,

>> How can I add the div to the Tabbar? 

You can use either:

dhxtabbarB.setContent("mdxb1", "dropcontainer"); 

where "dropcontainer" id of the existent html element.

or 

dhxtabbarB.setContentHTML("mdxb1", "<div id=\"dropcontainer\" height=\"100%\" width=\"100%\"></div>");

>> How can I acess the DIV "dropcontainer" and manipulate it?

If the element exists of the page (after one of the commands presemted above), you can use document.getElementById(elementID) method.