Attached PopUp

Can I attach popup to layout in code? Now, popup window’s html code generates outside of element, so if I destroy element popup element stays. I don’t want to destroy popup windows manually every time.

P.S. If I want to attach popup to some place I’ve got an error on showing popup
https://jsfiddle.net/mwn0zvvo/

There is a way to limit popup drag and show area to the layout. But event in such case, popup will not be destroyed with the layout.

You can use onDestruct event of layout, from which call the code to destroy a window.

Popup windows (webix_popup) don’t destroys on removing menu, datepicker, contextmenu. And in some cases I don’t know their id’s.

Destroying the menu or datepicker will destroy the related popup. ( all autogenerated popups are destroyed with their master component )

Contextmenu and custom popups will not be destroyed automatically, as they was created by custom code. In such case you have access to the popup object as it was created by your code and can link it destruction to any other component by using the onDestruct event.

I missed that fact. Thanks.