welcome to my space

Events in Ext

January 7th, 2009 Posted in noodtarareid.com | edit
  • Hi all,
    Is it possible to registration the event handler before handler with same name
    see example:

    this.addEvents(
    'myevent'
    );

    ....

    this.on({
    myevent: {scope: this, fn: this.onMyEvent}
    })

    ...
    somewhere below
    this.on({
    myevent: {scope: this, fn: this.onMyEventMainHandler}
    });


    Is it possible that the function {this.onMyEventMainHandler} run before {this.onMyEvent}?


  • You can add delays but there is no API method to change event firing order.


  • The events will be fired in the order they were defined (in script execution order).


  • It's a good thing that the order of the events is following the rules "first attached first notified" in my opinion, at least in the Observer class.

    You can create your own class adn implement a reorder strategy for ordering the objects to notify (for example a priority queue or whatever you need).

    Or if an object A and an object B that are registred to the same event and they need a coordination,maybe they could know each other and coordinates themselves...

    Only some ideas :)

    Hope this helps a little


  • The events will be fired in the order they were defined (in script execution order).

    Change ordering not possible?


  • this solution is not good for me :(
    Thanks for your reply







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Events in Ext , Please add it free.