Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.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
Extjs4 在extjsmvc中注册窗口卸载_Extjs4_Extjs Mvc - Fatal编程技术网

Extjs4 在extjsmvc中注册窗口卸载

Extjs4 在extjsmvc中注册窗口卸载,extjs4,extjs-mvc,Extjs4,Extjs Mvc,有人知道如何在ExtJS MVC应用程序中注册窗口卸载事件吗 Ext.EventManager.on(window, 'beforeunload', function() { alert('cross-exit tab click AND cross-exit browser click');}); 上面的代码需要放在一个javascript文件中。我不确定哪个文件应该包含上述代码 window.onbeforeunload = function() { return "You have ma

有人知道如何在ExtJS MVC应用程序中注册窗口卸载事件吗

Ext.EventManager.on(window, 'beforeunload', function() {
alert('cross-exit tab click AND cross-exit browser click');});
上面的代码需要放在一个javascript文件中。我不确定哪个文件应该包含上述代码

window.onbeforeunload = function() {
return "You have made changes, are you sure you would like to navigate away from the page?";}.bind(this);
上面的代码完成了这项工作。我把它放在我的主控制器下


上面的代码完成了这项工作。我将它放在主控制器下。

将它放在init方法内部的控制器中:

init: function(){

Ext.EventManager.on(window, 'beforeunload', function() {
    this.setAllValues(false);
});

this.control({
............
....

将其放在控制器的init方法内部:

init: function(){

Ext.EventManager.on(window, 'beforeunload', function() {
    this.setAllValues(false);
});

this.control({
............
....

,上面的url显示注册窗口卸载。上面的url显示注册窗口卸载。来自sencha论坛的帮助。来自sencha论坛的帮助。我已经试过了,把它放在应用程序的init下,但它不起作用。我试过了,把它放在应用程序的init下,但它不起作用