How to confirm Ext window close

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:

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Pin on PinterestEmail this to someone
Follow me:


I'm a well seasoned developer, consultant and educator of web applications based mainly on Sencha libraries, PHP, MySQL and Node.js. Besides (Apple) computers, I love photography and mountain biking.
Follow me:

Latest posts by Saki (see all)


We will be happy to hear back from you

Please Login to post a comment