Dynamically Created object doesn't display in DHTMLX Layout

Hi,

I tried to attach a dynamically created DIV element/object to a DHTMLXLayout window. It doesn’t display the contents of the DIV object. Instead just displays [object].

Listing the code below. Appreciate any feedback.

Thanks

<div id="parentId" style="position: relative; top: 20px; left: 20px; width: 600px; height: 400px; aborder: #B5CDE4 1px solid;"></div>

HI,

try the following:

dhxLayout = new dhtmlXLayoutObject(“parentId”, “3L”);
var divObj = document.createElement(‘div’); /"div instead of “div1"”/
var text = document.createTextNode(“some text”);
divObj.appendChild(text);
dhxLayout.cells(“b”).attachObject(divObj);

Thanks, that works.