【发布时间】:2016-09-20 09:58:57
【问题描述】:
我想在点击按钮时打开一个新窗口。在 cclick 上的按钮窗口打开和关闭正常,但第二次没有正确关闭。
这是我的代码
var formPanel = new Ext.FormPanel({
height: 125,
autoScroll: true,
id: 'formpanel',
defaultType: 'field',
frame: true,
title: 'CheckOut from SVN',
items: [{
fieldLabel: 'SVN Path'
}],
buttons: [{
text: 'Submit',
minWidth: 75,
handler: function() {
var urlTemp = './Export?' + '&' + fp.getForm().getValues(true);
formPanel.getForm().submit({
url: urlTemp,
method: 'Post',
success: successFn1,
timeout: 18000000,
failure: otherFn
});
}
}, {
text: 'Reset',
minWidth: 75,
handler: function() {
formPanel.getForm().reset();
}
}]
});
function buildWindow() {
var win = new Ext.Window({
id: 'newWindow',
layout: 'fit',
width: 300,
height: 200,
closeAction: 'hide',
plain: true,
stateful: false,
items: [formPanel]
});
win.show();
}
var extSVN = new Ext.Button({
text: 'Checkout from SVN',
minWidth: 75,
handler: function() {
buildWindow();
}
});
Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
width: 400,
height: 300,
items: [extSVN]
});
【问题讨论】:
-
你在做什么来关闭窗口?
-
将您的代码放入fiddle。
-
点击关闭图标(窗口的十字或“x”按钮)
-
尝试将 closeAction 改为 'destroy' 而不是 'hide'。