Title: onBeforeClose event in dialog Post by: galcott on September 28, 2020, 08:02:09 AM I have a dialog and I would like the user to confirm when they try to close it. In the onBeforeClose event I call a function to display a confirmation dialog and return the result. However, the dialog always closes immediately and then the confirmation is shown after it closes! I have tried several ways to show the confirmation dialog - native JS confirm, your messager, and another library to display confirmations. The same result occurs no matter how I do it. I have also tried putting the onBeforeClose code in the data-options, which makes no difference. So what is the problem here and how do I fix it?
Code:
Title: Re: onBeforeClose event in dialog Post by: jarry on September 28, 2020, 08:19:09 PM Please refer to the code below:
Code: $('#dlg').dialog({ Title: Re: onBeforeClose event in dialog Post by: galcott on September 29, 2020, 01:51:03 PM This code doesn't make sense to me. Why is it even necessary? And what is the enableClosed option? I can't find this anywhere in the documentation. It seems like the onBeforeClose event is not working as it should. Please explain.
|