0
中失敗我這樣定義http://jsfiddle.net/KABQD/
窗口下面是我的窗口EXTJS 4.1 - 隱藏窗口,並顯示它再次的MessageBox
Ext.define('MyWindow', {
extend: 'Ext.window.Window',
title: 'window',
width:200,
height:100,
modal:true,
closable:false,
tbar: [{
text:'hide',
handler:function(){
this.up('window').hide();
}
}]
});
和一個按鈕。如果點擊按鈕我的窗口將被創建並首次顯示。如果再次點擊按鈕,則會顯示窗口。但是,當我使用Messagebox時,它會失敗。
如何解決謝謝
這是我的按鈕
Ext.create('Ext.Button', {
text: 'Click me',
visible: false,
renderTo: Ext.getBody(),
handler: function() {
var x = 0;
Ext.WindowManager.each(function(win) {
x = 1;
win.show();
});
if (x == 0){
// if don't use MessageBox then will working
Ext.MessageBox.show({
msg: 'wait...',
progressText: 'Loading...',
width:300,
wait:true,
waitConfig: {interval:200}
});
//Ext.Ajax.request({
//url : 'example.php'
//,success: function(response, opts) {
var a = new MyWindow();
a.show();
Ext.MessageBox.hide();
//}
//});
}
}
});
我才明白這是爲什麼。 Extjs中的MessageBox和窗口都是窗口,並且都隱藏在我的問題中。但是如何知道如何捕捉並顯示我的窗戶?或如何關閉()MessageBox(不隱藏) – freestyle
我使用destroy()我的MessageBox和一切工作感謝幫助:) – freestyle