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.
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.