I would like to add feature where the window will ask the user if he wants to close this window or not.
Code below does not work
<script>
var app_win = // blah blah here
app_win.attachEvent("onClose", function(){
doconfirm("Do you want to close this window?",{
success: function(){
// app_win.close();
return true;
},
cancel: function(){
return false;
}
});
});
</script>
BTW I am creating a function to minimize code so I wrap the actions inside an object “success and cancel” methods.
The window still not closing even if you click the success (yes) button. It seems like the event is firing and returning false.
How can I implement such features? Any ideas? I don’t want to use the native confirm box since it does not have styles.
Take note: The modal confirmation is dhtmlx.alerts. I just wrap it inside doconfirm function to minimize code.