Object Destruction After Replacing In dhtmlxLayout

I am wondering why dhtmlxLayout destroys a

when another
is called to replace the present one.

Exa: I have 2
s and call

dhxLayout.cells(“a”).attachObject(“divObject01”);

Then I replace the Layout Window with

dhxLayout.cells(“a”).attachObject(“divObject02”);

Now I try to recall “divObject01” again using

dhxLayout.cells(“a”).attachObject(“divObject01”);

which draws an error saying that “divObject01” is either null or not an object. I.E., completely destroyed.



If I use these in other dhtmlx components the
survives intact - even with any on-the-fly changes to the
. But dhtmlxLayout does not follow this same behavior.



I note too that dhxLayout.cells(“c”).attachURL("…/Folder/File.html"); works repeatedly with no problems as it is built/attached from an outside source.



I request that you not destroy the replaced Object using attachObject() in dhtmlxLayout so that I can use and reuse the same
over and over.


attachObject method replaces an object from some position into layout cell. When you call this method again, the new object replaces the previous one.


You can use another approach to change cell content dynamically.


For example, attachObject can be called only once for some object, and then content will be attached to this object dynamically (using any known approach).


You can also try to use the following approach


For example there are two objects:







dhxLayout.attachObject(“m1”);


Before attaching “m2” you can move the object “m1” to the body:


document.body.appendChild(document.getElementById(“m1”))
document.getElementById(“m1”).style.display=“none”;


dhxLayout.attachObject(“m2”);




Thank You!


Works even better than expected!