添加取消按钮以取消打开的窗口

问题描述 投票:0回答:1
var messagebox = Ext.widget("messagebox", {
  target: grid,
  progressMessage: "Loading"
});

按下下载按钮时,以上消息框显示加载进度栏。我需要添加一个取消按钮以取消执行以下弹出窗口。有人可以帮我取消弹出窗口下方的内容吗?

var win = new Ext.Window({
  title: "popup",
  width: 50,
  height: 50,
  layout: "fit",
  items: [
    {
      xtype: "component",
      autoEl: {
        tag: "popup",
        src: "www.google.com"
      }
    }
  ],
  listeners: {
    show: function() {
      setTimeout(function() {
        popup.close();
      }, 2000);
    }
  }
}).show();
javascript extjs
1个回答
0
投票

怎么样:win.close()

var win = new Ext.Window({
  title: "popup",
  // rest of the code
}).show();

btn.addEventListener("click", () => {
  win.close()
})
© www.soinside.com 2019 - 2024. All rights reserved.