Extjs4 在extjsmvc中注册窗口卸载
有人知道如何在ExtJS MVC应用程序中注册窗口卸载事件吗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
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下,但它不起作用