隐藏/显示受约束的窗口

时间:2014-05-02 08:21:23

标签: extjs extjs4 extjs4.2

我们正在努力防止不必要的渲染,因此只想隐藏并显示一个包含相当大的网格的窗口。

通过调用

,窗口本身被约束到视口
App.Instance.getViewPort().add(scope.myWindowRef = Ext.create('Ext.Window'),{ 
    constrainHeader: true 
    /* and the rest of the cfg */ 
});
scope.myWindowRef.on('close',function(win){ win.hide(); win.caller.enable(); return false; });

我们在控制器内部有一个按钮侦听器,现在应该show hide窗口

onOpenWin: function(button) {
    button.disable();
    var scope = this,
        win = scope.myWindowRef;
    win.caller = button;
    win.show();
}

2 个答案:

答案 0 :(得分:2)

如果要停止销毁窗口,则应使用beforeclose事件。关闭事件已经晚了!

答案 1 :(得分:1)

结帐closeAction配置 - closeAction:'hide'应该......