2
ExtJS MessageBox似乎不會像JavaScript警報(..)那樣阻止。我想顯示一個彈出窗口,然後調用和AJAX調用,然後關閉窗口。ExtJS MessageBox不會像塊警報(..)那樣阻止(..)
如果我這樣調用,則顯示方法......
//Alert Box :
var alertBox = Ext.create('Ext.window.MessageBox');
var config = {
title : 'Title',
closable: true,
msg: 'Message',
buttons: Ext.Msg.OK,
buttonText: { ok: EML.lang.buttons.ok },
modal: true
};
alertBox.show(config);
//callback
Ext.Ajax.request({
url: someURL,
method: 'POST',
callback: function (options, success, response) {
//do some stuff
self.up('window').destroy();
}
})
..no彈出所示,但是父窗口關閉。
如果我使用標準的Javascript 警報那麼警報將會阻止。點擊確定按鈕後,執行回調後窗口關閉。
//Alert Box :
alert('asdf')
//callback
Ext.Ajax.request({
url: someURL,
method: 'POST',
callback: function (options, success, response) {
//do some stuff
self.up('window').destroy();
}
})
- 爲什麼MessageBox中沒有阻止?
- 我能做些什麼來解決這個問題?
- MessageBox以某種方式需要知道關於父窗口來阻止?
是的,我最終實現它是這樣的。它讀得不好。如果我有連續5個警告框的情況怎麼辦?在JavaScript中,我只需要5行警報(..)。在Extjs中,我需要在對方中嵌入5個消息框,看起來像一團糟...除非有承諾的方式 –
@OliverWatkins我已經修改了我的答案。 – Alexander