It may sometimes be needed to ask the user if he really wants to close an Ext window. Naturally, we would use Message Box for this purpose, and we would listen to beforeclose returning false if the user does not want to close, answers "No."
And now comes the problem: Message Box is, unlike browser alert dialog, asynchronous. The execution of code does not stop when it is displayed but it immediately continues. We do not have time to evaluate the user response before returning false from the beforeclose event to cancel the close.
Fortunately, solution is easy:
How to confirm Ext window close
This is an archived post from the ExtJS era — the code may be obsolete, but the principles often still apply.



3 comments
Comments are closed on archived posts.