I'm tyring to catch the page leave event & check if the user have any unsaved changes. When I'm trying with alert, its working fine, the page reloading/leaving after I press the ok button on alert box as expected. But I'm trying to use kendo window for the confirmation with yes, no & cancel button. The problem is kendo window can't prevent the page from leaving or reloading, it just pops up & the page leaves almost immediately, leaving the user no time to respond to the window. I would like to stop the page from leaving until I press a button on kendo window.
Here is my code:
window.onbeforeunload = function (e) {
if (changeStatus == 1)
{
//e.preventDefault();
saveChangeWindow.open();
//alert("test");
}
};
if I place the e.preventDefault(), then the page is waiting but an default message showing, which I don't actually need. Please help.