ExtJS MessageBox似乎不像Javascript的alert(..)一样阻塞。我想显示一个弹出窗口,然后调用AJAX调用,之后它将关闭窗口。
如果我像这样调用show方法...
//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();
}
})
没有弹出窗口,但是父窗口被关闭了。
如果使用标准的Javascript alert,那么弹出框会阻塞。在点击“确定”按钮之后,回调函数会执行,然后窗口关闭。
//Alert Box :
alert('asdf')
//callback
Ext.Ajax.request({
url: someURL,
method: 'POST',
callback: function (options, success, response) {
//do some stuff
self.up('window').destroy();
}
})
- 为什么弹出框不会阻塞程序?
- 我该怎么解决这个问题?
- 弹出框是否需要知道父窗口才能阻塞程序?