javascript - Ext.EventManager is deprecated in ExtJS 5 -


in extjs 5 i'm getting console warning saying

[w] ext.eventmanager deprecated. use ext.dom.element#addlistener attach event listener.

i using code statement bellow,

ext.eventmanager.on(window, 'beforeunload', function() {     //code here }); 

i understand ext.eventmanager deprecated how should replace code statement work in extjs 5 ?

use getwin() method , append event handler using on.

ext.getwin().on('beforeunload',function(){     //code here }); 

other possible option use pure javascript.

window.onbeforeunload = function(){     //code here };   

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -