how do I close a window or create a dynamic id

I created a component window that has a datatable. If there is an error in one of the cells the user can click on that cell and more information will pop up. I used a window with yet another datatable inside because I could not get the message box to display the text I wanted nicely. Anyways, this works as intended. The problem is that I want to enable the user to close the window. So I did the command as in the example provided click:"$$(‘win3’).close();" . Ok, that is fine and dandy as long as 1) the id of the window is win3 and 2) an user doesn’t open multiple windows. you see, if the user opens multiple windows then he can close the first window fine but!!! when closing the second windows there is an error because the id is no longer valid. So how do I reference a dynamic ID or create a dynamic id? the webix.message widget has the right behavior. I tried something along the lines of click:this.close() but that didn’t work. Alternatively, how do i make it so that the webix.message box can format text nicely?

Excellent!!! the “this.getTopParentView()” was exactly what I was looking for. Thanks.

Do you want to close window by some button or by any click outside of the window ?

In first case you can use this.getTopParentView() from any in-window event handler to locate the window object and call the close method
http://webix.com/snippet/0dc14d4d

In second case just use “popup” instead of “window”, it will hide self automatically