Results 1 to 4 of 4

Thread: General EventManager question

  1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    532

    Default General EventManager question

    After using Ext.EventManager.on() to add a listener, is it necessary to call Ext.EventManager.un() to remove it, or does EventManager automatically "clean up" after itself? If not, why is there no Ext.EventManager.mon() function?

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Location
    USA
    Posts
    111

    Default

    I`m not sure, but I guess listener not clean up automatically

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    EventManager does clean up on window unload, but you should still write proper cleanup code if the event is part of a component (in case only the component needs to be destroyed).

    Also have a look at Ext.Component.mon()

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    I have never tried it but in the options object that you can specify (not required), you can set 'single: true' and it says it will remove itself. Look at the addListener function (which is the same as the on function).
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Similar Threads

  1. General cookie question
    By fetchinson in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 22 Jun 2009, 3:54 PM
  2. General Question
    By RyanZec in forum Ext 1.x: Help & Discussion
    Replies: 9
    Last Post: 1 Nov 2007, 12:13 AM
  3. A general question about using this code
    By JohnT in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 16 Jan 2007, 7:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •