Friday, April 10, 2015

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.

No comments:

Post a Comment