Page 1 of 1

Prevent dialog closing...

PostPosted: 13 Mar 2019 02:49
by zsleo
I have a Dialog (and also DialogEx) that with some logic checking I want to stop from closing if the user presses ESC or clicks the "X" button.

How do I do this in the OnClose (or other) event?

TIA

Re: Prevent dialog closing...

PostPosted: 15 Mar 2019 13:20
by Alexander Bulei
Hi zsleo,

Unset the Closable & CloseOnEscape properties, and when you need close it, close it by method.

Best Regards.

Re: Prevent dialog closing...

PostPosted: 15 Mar 2019 20:26
by zsleo
Thanks, but I already know that.

If I there will be 3 or 4 of a about 40 dialogs in the app that will not CloseOnEscape.

I want to avoid that bad app / user experience.
.

Re: Prevent dialog closing...

PostPosted: 12 Jun 2019 21:07
by fduenas
zsleo wrote:I have a Dialog (and also DialogEx) that with some logic checking I want to stop from closing if the user presses ESC or clicks the "X" button.

How do I do this in the OnClose (or other) event?

TIA


I use this, I normally set it in the OnCreate event of the frame:

MyDialog.JQDialogOptions.Modal := true;
MyDialog.JQDialogOptions.OnBeforeClose.Script:= 'function (event, ui){ return false; }';