Detach an object from windows

Hello,

I’ve a problem for detaching an object from a window and keep it in the original div

  1. I’ve a window
  2. Inside this window, I’ve a div.
  3. I create a tree
  4. I attach the the div to the tree
  5. I create another window inside this window
  6. I attach the tree to this new window
  7. The user close the window => I call parent.dhxWins.window(‘win_tree’).detachObject(true); before closing it.

The problem :

When I want open a new window with the original tree, I’ve a js error that telling me that the div containing the tree is null.

It sound like a bug with detachObject method, no ?

Thanks for any answer :slight_smile:

Hello,

detachObject(true) removes the object. Try to call detachObject(false) or detachObject()

Hello Alexandra,

I’ve tried detachObject(false) and detachObject() but the result is the same :frowning:

Hello,

we have tested:
w1.attachObject(‘obj’);
w1.detachObject(false)
w1.attachObject(‘obj’);

The object is not removed from the page and attached to the window the second time (we have tested v.3.0). Please attach the complete demo if the problem is not solved.