Closing a dhtmlxWindow via API

Is it possible to close a dhtmlxWindow from within the contents of the window? I thought the close() function would be able to do it but I get an error that the “win” object I used to create the window is not defined. How can I pass the window object I created to the window itself or is there is win.self object available…?


If you use iframe loading mode, you can use the approach as presented at the dhtmlxWindows/samples/init/inner_close.html sample.


If you face with another issue, please, provide a sample.