gently detach the object from window without destroing it


in our previous conversation:



posted: Jan 27, 2009 05:44 | Direct link: dhtmlx.com/docs/products/kb/inde … 79&a=11592
If you need not old object you can just use
         MyUniversialWindow.window(“createNewWorld”).attachObject(“updateExistingWorldDiv”);
It will destroy old object automatically.




My new question:



But,  I will need this object createNewWorldDiv again, e.g.:



MyUniversialWindow.window(“createNewWorld”).attachObject(“createNewWorldDiv”);



createNewWorldDiv object will be destroyed and I will not be able to re-use it.  I need: gently detach the object so I will able to attach it at some point again.



Thanks again.

Solutions:

1. You can use appendObject() method and show/hide used/unused objects
dhtmlx.com/docs/products/dhtmlxW … 3141707000

2. You and detach it manually, for example:
<div id=“myObject”…>
<div id=“myOtherObject”…>
// attaching 1st object
dhxWins.window(“w1”).attachObject(“myObject”);
// detaching 1st object
document.body.attachObject(“myObject”); // <-- this will reattach object to body so window won’t destroy it
// attaching 2nd object
dhxWins.window(“w1”).attachObject(“myOtherObject”);