Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ruquia on Jan 20, 2009 22:33
open dhtmlx forum
attach more than one object to layout

Hi i want to attach more than one object to layout cell but this is not being possibly done here can you suggest me how to do i have got 2 iframes and i want to attch them to a layout cell and  make any one visible on demand.

 


    var dhxLayout = new dhtmlXLayoutObject("maindiv", "2U", "dhx_blue");
 var dhxLayout2 = new dhtmlXLayoutObject(dhxLayout.cells("b"), "3E");

 

dhxLayout2.cells("a").attachObject("iframe2");
 dhxLayout2.cells("a").attachObject("iframe3");
dhxLayout2.cells("a").attachObject("iframe4");
 dhxLayout2.cells("b").attachObject("iframe5");
 dhxLayout2.cells("c").attachObject("iframe6");

 

 

 document.getElementById('iframe2').src="STOBatchPreparationServiceFee";

 

 

 

here i am getting error

Error:-

document.getElementById("iframe2") is null
(?)()()StoFewa.js (line 216)
addEvent()()dhtmlxtree.js (line 260)
z()()dhtmlxtree.js (line 258)
_unselectItems()(click clientX=130, clientY=79, undefined, undefined)dhtmlxtree.js (line 114)
document.getElementById('iframe2').src="STOBatchPreparationServiceFee";


 

Answer posted by Support on Jan 21, 2009 03:59
Hello,

Such feature will available if future release. Now you use something like this:

<div id="mainObj">
    <iframe id="f1"></iframe>
    <iframe id="f2"></iframe>
    <iframe id="f3"></iframe>
    ...
</div>

dhxLayout.cells("a").attachObject("mainObj");

and then manualy show/hide iframes through document.getElementById("f1").style.display