javascript - ExtJs 自动隐藏窗口

标签 javascript extjs window hide extjs3

我想让状态窗口根据用户的操作显示一些数据。如何才能让窗口10秒后自动隐藏?

 this.statusWin = new Ext.Window({
     height: winHeight,
     x: document.body.clientWidth - winWidth,
     y: document.body.clientHeight - winHeight,
     width: winWidth,
     layout: 'fit',
     items: status_message,
     baseCls: 'lk-statusWindow',
     hideBorder: false,
     resizable: false,
     closeAction: 'hide',
     plain: true
 });

使用ExtJs3.4

最佳答案

您可以延迟调用函数:

var closeWithDelay = new Ext.util.DelayedTask(function(){
    this.statusWin.hide(); // or destroy
});

this.statusWin.on('show', function(){
    closeWithDelay.delay(10000); 
});

关于javascript - ExtJs 自动隐藏窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19241310/

相关文章:

javascript - 调用在 var 中分配的 url

extjs - 如果在特定列上完成拖动,则启用行的拖放

extjs - 在 ExtJS 中,调用 Model.save() 还是 Store.Sync() 更好?

JQuery 与 ExtJS

batch-file - 在新窗口中从批处理运行批处理文件?

javascript - 切换类别并向下滑动

javascript - 如何在不阻止 ListView 中的 UI 可视化更改的情况下处理点击事件

wpf - xaml中图像源路径是什么意思?

javascript - JQuery - 响应式字符串 trim 难题

c++ - 尝试使用 dev-C++ 创建 .exe 时出现错误 255