Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 在外部窗口中淡入/淡出_Extjs - Fatal编程技术网

Extjs 在外部窗口中淡入/淡出

Extjs 在外部窗口中淡入/淡出,extjs,Extjs,我正在使用 var modalWindow = new Ext.Window({ title: "Window", items: [ {html: "<div id='example'>Hello</div> "} ] }); modalWindow.show(); var modalWindow=新的外部窗口({ 标题:“窗口”, 项目:[ {html:“你好”} ] }); modalWindow.show(); 打开一个模态窗口。我需要此窗口上的淡入淡

我正在使用

var  modalWindow = new Ext.Window({
title: "Window",
items: [
    {html: "<div id='example'>Hello</div> "}
]
});
modalWindow.show();
var modalWindow=新的外部窗口({
标题:“窗口”,
项目:[
{html:“你好”}
]
});
modalWindow.show();
打开一个模态窗口。我需要此窗口上的淡入淡出功能。 请帮忙

这应该可以做到:

    var  modalWindow = new Ext.Window({
        title: "Window",
        width: 400,
        height: 300,
        html: "<div id='example'>Hello</div> ",
        listeners : {
            show : function(window) {
                window.getEl().setOpacity(0);
                window.getEl().fadeIn({duration: 2000});
            },
            beforeclose : function(window) {
                if(!window.shouldClose) {
                    window.getEl().fadeOut({duration: 2000, callback: function() {
                        window.shouldClose = true;
                        window.close();
                    }});
                }
                return window.shouldClose ? true : false;
            }
        }

    });
    modalWindow.show();
var modalWindow=新的外部窗口({
标题:“窗口”,
宽度:400,
身高:300,
html:“你好”,
听众:{
显示:功能(窗口){
window.getEl().setOpacity(0);
window.getEl().fadeIn({duration:2000});
},
关闭前:功能(窗口){
如果(!window.shouldClose){
window.getEl().fadeOut({duration:2000,callback:function()){
window.shouldClose=true;
window.close();
}});
}
返回窗口.shouldClose?真:假;
}
}
});
modalWindow.show();

在我试图理解代码时,您能解释一下window.getEl()吗。。我没有得到在show Function中作为参数传递的确切内容。我必须以不同的方式进行操作,因为我希望某些窗口继承此行为。所以我使用windowinitcomponent函数,在这个函数中我有:
var me=this;me.callParent(参数);on(“beforeclose”,函数(window,eOpts){//same code})
@gabrielhautclock如果有许多选项,您可以覆盖
窗口
关闭方法。但是,如果您坚持将侦听器添加到
initComponent
,请记住,不需要在该方法中向callParent传递
参数。