Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default [OPEN-718] Ext.Button.purgeListeners() doesn't clear handler config

    [OPEN-718] Ext.Button.purgeListeners() doesn't clear handler config


    I have just noticed that when using the handler config option on a Ext.Button, instead of registering the handler function to the click event of the button, it manages the handler configuration independently. This means that even when you are making a call to Ext.Button.purgeListeners(), the handler function is getting executed when the button is clicked.

    I think this behavior should be normalized.

    Thanks!

  2. #2
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default Will it be addressed?

    Will it be addressed?


    Will it be adressed or it's not considered as an issue?

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,657
    Vote Rating
    584
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I don't really feel strongly either way about this one, I can see where it might make sense to do this. 99/100, people won't call purgeListeners without destroying the component anyway.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    Well, letting it like that means that you must code for exceptions, which is a bad thing.
    I don't see any points in favor of making the handler configuration completely independant from the whole events model but I can see at least one drawback: purgeListeners() is not really doing what it should, leaving behind one listener on the button. At least, it should be said in the documentation that the handler configuration is not getting cleared by the purgeListeners() method and that you need to manually delete the handler configuration to get rid of that listener.

    Anyway, I don't think it would requires a lots of changes in Ext code...

  5. #5
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    *bump*

Thread Participants: 1