title: Registering Window Unload in extjs mvc
body: <p>Do anyone have an idea about, how to register the window unload event in an ExtJS MVC application.</p>
  
  <pre><code>Ext.EventManager.on(window, 'beforeunload', function() {
  alert('cross-exit tab click AND cross-exit browser click');});
  </code></pre>
  
  <p>The above code needs to be placed in a javascript file. I'm not sure which file should carry the above code. </p>