Reputation: 1606
I have a code which looks like this:
Ext.Msg.prompt( Translation.RefusalMessageBoxTitle, "",
function(btn, text, cfg ){
if(btn == 'ok' && Ext.isEmpty(text)) {
var newMsg = '<span style="color:red;" class="error">' + Translation.RefusalMessageBoxEmpty + '</span>';
Ext.Msg.show(Ext.apply({}, { msg: newMsg }, cfg));
}else if( btn !== 'ok' ){
return;
}else if( btn == 'ok' ){
this.sendRefusalAnswer( methodName, text, "reject", Constant.DocumentStatus.REFUSED, me.selectedDocument.get('id'));
}
}, this, true, '' );
Now mz problem is that the
var newMsg = '<span style="color:red;" class="error">' + Translation.RefusalMessageBoxEmpty + '</span>';
Ext.Msg.show(Ext.apply({}, { msg: newMsg }, cfg));
part of the code gets executed, but then the box closes imidietly... how can i prevent that??? any ideas?
EDIT:
This happens only on EXTJS 4.2 build Build date: 2013-03-11 22:33:40 (aed16176e68b5e8aa1433452b12805c0ad913836) ONLY!!!!!
the version Build date: 2013-05-16 14:36:50 (f9be68accb407158ba2b1be2c226a6ce1f649314) works just fine °-°
Upvotes: 1
Views: 2575
Reputation: 1606
Ok I found it... the damn build version was diferent on mz build machine.
I locally have
Build date: 2013-03-11 22:33:40 (aed16176e68b5e8aa1433452b12805c0ad913836)
And on mz test machine we have
Build date: 2013-05-16 14:36:50 (f9be68accb407158ba2b1be2c226a6ce1f649314)
On my local it dous not work... but on the test machin it works without problems... 3 MONTHS! wtf!
Upvotes: 0
Reputation: 1606
I converted it to a message object:
Ext.Msg.show({
title: Translation.RefusalMessageBoxTitle,
minWidth: this.minPromptWidth,
buttons: Ext.Msg.OKCANCEL,
callback: function(btn, text, cfg ){
if(btn == 'ok' && Ext.isEmpty(text)) {
var newMsg = '<span style="color:red;" class="error">' + Translation.RefusalMessageBoxEmpty + '</span>';
Ext.Msg.show(Ext.apply({}, { msg: newMsg }, cfg));
}else if( btn !== 'ok' ){
return;
}else if( btn == 'ok' ){
this.sendRefusalAnswer( methodName, text, "reject", Constant.DocumentStatus.REFUSED, me.selectedDocument.get('id'));
}
},
scope:this,
multiline: true,
});
But still cant figure out how to prevent it from closing on me °_°
Upvotes: 0
Reputation: 25031
Don't use the Ext.Msg
singleton, but rather regular windows or create multiple instances of Ext.window.MessageBox
yourself. The singleton is itself a window, and the component is shared by all calls to alert
, confirm
, prompt
, etc., so it won't be possible to show multiple windows at the same time with it.
Upvotes: 1