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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -