Sencha Touch MessageBox Can Not Be Closed.

Recently in one of my Sencha Touch project, I had an issue with MessageBox, specifically in Android. The issue was when user taps on Ok button message box does not go away. Ideally it should hide, but instead of that it’s body is still visible and due to that app was not usable. Issue was hide animation of message box. ActiveAnimation is blocking messagebox from closing properly, so the workaround is to force “end” function of that animation. it was not ended correctly, probably because of events.

Add following code to your application.

 Ext.override(Ext.MessageBox, {    
            hide:  function() {
                if (this.activeAnimation && this.activeAnimation._onEnd) {
                    this.activeAnimation._onEnd();
                }
                return this.callParent(arguments);
            }
});
This will solve your problem. Now message box will be hidden as soon as you tap on Ok button. Hope this helps you.
This entry was posted in Mobile Application, Sencha, Sencha Touch, Sencha Touch 2 on by .

About Hiren Dave

Hiren Dave is a software engineer, blogger and consultant with over 9 years of professional experience. He writes code in number of languages. Hiren has a passion for developing web apps, mobile apps and writing books and blog articles about programming. He has a solid experience of startups as he manages products for few startups. He is also passionate about researching and learning new technologies and trends. He has also authored a book Instant Sencha Touch, published by Packt and creator of Video Course "Beginning Laravel" for Packt

Leave a Reply

Your email address will not be published. Required fields are marked *