Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jeff on Oct 07, 2009 07:07
open dhtmlx forum
Attach two grid in one layout cell

Hi,

I just want to attach two grid in one layout cell.

I've tried :

<table id="gridbox"><tr><td>
<div id="gridbox1" style="width:1200px;height:600px;"></div>
</td></tr><tr><td>
<div id="gridbox2" style="width:1200px;height:600px;"></div>
</td></tr></table>

mygrid = new dhtmlXGridObject('gridbox1');
mygrid2 = new dhtmlXGridObject('gridbox2');
dhxLayout.cells("c").attachObject("gridbox");


and

mygrid = dhxLayout.cells("c").attachGrid();
mygrid2 = dhxLayout.cells("c").attachGrid();


but nothing is working, is it possible to attach two grid in one cell ?

Regards,

Jeff
Answer posted by Stanislav (support) on Oct 07, 2009 09:39
You can use
     var sub_layout = dhxLayout.cells("c").attachLayout("2E");
     sub_layout.cells("a").attachGrid();
     sub_layout.cells("b").attachGrid();

Technically, the first solution with html code for both grids and attachObject is also correct, and must work. But sizing of grids in such case will be a pain. 

Answer posted by Jeff on Oct 14, 2009 02:29
Thanks for your answer.

I work with the version 2.1 and it seems that "attachLayout" isn't a function of the cell object. What can I do ?