Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dashen on Apr 09, 2009 08:56
open dhtmlx forum
nested cells: how can i transfer the variables between nested cells.

Hello,

my codes:


file: layout.jsp
...
dhxLayout = new dhtmlXLayoutObject("parentId","3L");
layout1 = new dhtmlXLayoutObject(dhxLayout.cells("a"),"3E");

in layout1 .cells("a") there was a index-tree.
i wanted to use a grid in dhxLayout.cells("c"); when i clicked a node of index-tree, related information would be display in that grid.


layout1.cells("a").attachURL("<%=basePath%>/integratedView.jsp");

this code was written in the page integratedView.jsp and the url of tree node like :

javascript:dhxLayout.cells('c').attachURL('<%=basePath%>infoProcessValidation.do?method=show&processId=<%=processId%>

then there was a error: "dhxLayout is not defined". certainly "dhxLayout" was not defined in integratedView.jsp.

how can i implement it? how can i transfer this javascript variable to the url-page of nested cells.

best regards

Dashen






Answer posted by Alex (support) on Apr 13, 2009 02:11

Hello, 

attachURL loads page into iframe. So, this fact must be taken into consederation.

The iframe is available by the following property:

var frame = dhxLayout.cells("c")._frame;

You can get grid object by frame.contentWindow.gridObject;

var grid =  frame.contentWindow.gridObject


If this approach must be called from another iframe, something as follows can take place:

tree.attachEvent("onClick",function(id){

var frame = parent.dhxLayout.cells("c")._frame;

var grid =  frame.contentWindow.gridObject;

...

})