EXTJS关闭一个窗口

时间:2012-12-13 22:18:12

标签: extjs extjs4 extjs4.1

我有一个窗口。我在窗口右上角的默认关闭按钮上遇到了一些问题。因此我想禁用该关闭按钮并添加关闭按钮,以便在用户单击时禁用/删除窗口。删除/关闭窗口的代码是什么。

Window定义如下;

Ext.define('MyApp.view.MyWin', {
    extend: 'Ext.window.Window',
    alias: 'widget.mywin',
......

1 个答案:

答案 0 :(得分:22)

只是close()

工作example

new Ext.window.Window({
    title: 'A window',
    closable: false, // hides the normal close button
    width: 300,
    height: 300,
    bbar: [
        {
            text: 'Close',
            handler: function () { this.up('window').close(); }
        }
    ],
    autoShow: true
});
相关问题