Detaching from Layout

Is there a way to detach an object from the layout? I am attaching differents objects at different times and I am getting errors messages indicating that the obj is null. Any advice?

Please, take a look at the following answer dhtmlx.com/docs/products/kb/inde … mal&q=8601
Probably it’ll solve the issue