PDA

View Full Version : [FIXED] Ext.MessageBox.onClick should first hide the MessageBox and then invoke the callback



r_honey
27 Nov 2011, 2:18 PM
Here's the current code of Ext.MessageBox.onClick:



onClick: function(button) {
if (button) {
var config = button.userConfig || {};


if (typeof config.fn == 'function') {
config.fn.call(
config.scope || null,
button.itemId || button.text,
config.input ? config.input.dom.value : null,
config
);
}


if (config.cls) {
this.el.removeCls(config.cls);
}


if (config.input) {
config.input.dom.blur();
}
}


this.hide();
},


Here the callback method is invoked first and this.hide() is call later. But if we do another Ext.Msg.alert in the callback, it immediately gets hidden because of the this.hide() call later.

e.g.



Ext.Msg.confirm('title', 'Do you really want to delete this item', function(btn) {
if(btn=='yes') {
Ext.Msg.alert('title', 'The item has been removed');
}
});


The second alert never gets shown (rather it gets shown but immediately gets hidden then.

Jamie Avins
28 Nov 2011, 10:13 AM
Thank you for the report.