Search code examples
extjsextjs3

listener function on page refresh


Can add a listener to whenever a page is refreshed or clicked?

When the page is refreshed it needs to call this function:

TableTT.hide()

Is this possible?


Solution

  • HTML page reloads can be reacted to by placing the appropriate code in an window.onload handler, some more info: http://roberthahn.ca/articles/2007/02/02/how-to-use-window-onload-the-right-way/

    in general javascript you could do

    window.onload = function () {
        TableTT.hide();
    }
    

    in ext-js you can simply add the function to your listeners

    var eg = Ext.create('widget.window', { width: 600, height: 800, ... });
    eg.on('load', function(){
                  TableTT.hide();
                 } );
    eg.load();