代码如下:
function init() {
win = Ext.create("Ext.Window", {
title : "ExtJS Window",
width : 500,
height : 300,
contentEl: 'content',
buttons : [ {
text : "确定",
handler: function () {
this.up("window").close();
}
} ],
listeners: {
close: function () {
alert("关闭");
}
},
autoShow : false
});
}
var win;
Ext.onReady(init);
添加closeAction: 'hide'为正解