【问题标题】:browser closure confirmation on ext.netext.net 上的浏览​​器关闭确认
【发布时间】:2018-05-31 22:15:59
【问题描述】:

我想做的是以下

      window.onbeforeunload = function (e) {
          return 'Dialog text here.';
          Ext.Msg.confirm("Confirmación", "Seguro que quieres salir", function (btnText) {
              if (btnText === "yes") {                
                 App.direct.RegistrarAbandono();
              }
          }, this);
      };

也就是说,我希望如果该人离开浏览器能够从服务器删除或执行某些操作,并通知将对表单产生某些后果的人。

非常感谢

【问题讨论】:

  • 你不能暂停/暂停 window.onbeforeunload 事件。所以这里没有显示对话框。
  • 还有一个可能的解决方案?或如何做我想做的事?
  • 可以做的是您只能更改 beforeunload 对话框中存在的消息。而且我认为您应该显示一些消息,例如无法保存更改。

标签: extjs ext.net


【解决方案1】:

尝试使用以下代码:

Ext.EventManager.on(window, "beforeunload", function (e) {
                 Write your code here
        }, this, {});       

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 2020-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-04
    • 1970-01-01
    相关资源
    最近更新 更多