Hello Steufa,
In this dojo you'll find a demo of the desired behavior.
The following steps will guide you in implementing the desired behavior:
1) You need to bind the
destroy() method on the
close event of the kendo Window to ensure the HTML elements of the widget are removed from the DOM upon closing.
2) The
beforeunload event fires when the window, the document and its resources are about to be unloaded. That is whenever the user tries to leave the browser page. When the event occurs you check whether the kendo Window is present on the DOM and display the alert if present.
In this dojo you'll find the code snippet you provided, slightly modified, demonstrating the desired behavior.
I hope this helps. Let me know if you have further questions.
Regards,
Aleksandar
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.