How to detach in correct order

Hi,

I’m a litte bit confused about how to detach objects.

I have in “body” a layout (mylayout). Attached to these is a window (mywin) and attached to the window is a form (myform).

How to detach and clear all 3 components in case I want to load the “body” new with a different page.

Greetings

There is a .unload method
You need to call it for topmost UI in hierarchy only - the topmost layout in your case, all inner components will be unloaded automatically

docs.dhtmlx.com/api__dhtmlxlayout_unload.html