Categories | Question details Back To List | ||
Object Destruction After Replacing In dhtmlxLayout I am wondering why dhtmlxLayout destroys a <DIV> when another <DIV> is called to replace the present one. Exa: I have 2 <DIV>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 <DIV> survives intact - even with any on-the-fly changes to the <DIV>. 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 <DIV> over and over. Answer posted by Alex (support) on Feb 13, 2009 04:05 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).
Answer posted by Alex (support) on Feb 13, 2009 04:20 You can also try to use the following approach For example there are two objects: <div id="m1" style="display:none;" >...</div> dhxLayout.attachObject("m1"); Before attaching "m2" you can move the object "m1" to the body: document.body.appendChild(document.getElementById("m1")) dhxLayout.attachObject("m2"); Answer posted by Larry Hamlet on Feb 14, 2009 08:50 Thank You! Works even better than expected! |