Results 1 to 4 of 4

Thread: Store.getListeners doesn't seem to work correctly.

    You found a bug! We've classified it as TOUCH-2723 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    212
    Vote Rating
    3
      0  

    Default Store.getListeners doesn't seem to work correctly.

    I'm trying to setup a store.load listener once, but there is no convenient way to determine if a store listener is already set.

    I've experimented with a few approaches and none seem to work.

    store.on({'load': ...
    store.getListeners() - returns null

    store.setListeners({'load': ...
    store.getListeners() - returns null

    The getListeners probably works if you specify a listener in the Ext.Container config, but this is not very flexible and doesn't seem appropriate for the MVC model.

    If this is the correct getListeners behavior, please let me know the best way to determine if a listener, specified with store.on(), is set.

    Thanks

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Vote Rating
    1297
      0  

    Default

    Thanks for the report. Here is the test case:

    Code:
    var store = new Ext.data.Store({
        fields : ['test']
    });
    
    console.log(store.getListeners());
    
    store.on('load', Ext.emptyFn);
    
    console.log(store.getListeners());
    
    store.setListeners({
        load : Ext.emptyFn
    });
    
    console.log(store.getListeners());
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    15
    Vote Rating
    1
      1  

    Default

    +1

    obj.getListeners() returns null
    obj.hasListener('tap') returns true

    is a fix coming?

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    45
    Vote Rating
    0
      0  

    Default

    I'm still having this issue in Touch 2.2.0, is there a workaround available while we wait for a fix?

Posting Permissions

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