Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.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 ext.net上的浏览器关闭确认_Extjs_Ext.net - Fatal编程技术网

Extjs ext.net上的浏览器关闭确认

Extjs ext.net上的浏览器关闭确认,extjs,ext.net,Extjs,Ext.net,我想做的是以下几点 window.onbeforeunload = function (e) { return 'Dialog text here.'; Ext.Msg.confirm("Confirmación", "Seguro que quieres salir", function (btnText) { if (btnText === "yes") {

我想做的是以下几点

      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);
      };
也就是说,我希望如果用户离开浏览器,能够从服务器上删除或执行某些操作,并通知用户,因为用户将对表单的avandonar产生一些影响

非常感谢

尝试使用以下代码:

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

您无法停止/暂停window.onbeforeunload事件。因此没有必要在此处显示对话框。有什么可能的解决方案?或者是我想要的方法?可以做的事情是你们只能更改“卸载前”对话框中显示的消息。我认为你们应该显示一些消息,比如更改无法保存。