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
    bweiler is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    bchock is on a distinguished road

      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
    cooperka is on a distinguished road

      0  

    Default


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

  5. #5
    Sencha User
    Join Date
    Jun 2013
    Location
    New York
    Posts
    10
    Vote Rating
    -15
    Harlowsmith is infamous around these parts Harlowsmith is infamous around these parts

      -2  

    Default


    Hey thanks providing this information on this thread. It has really helped me in solving my problems.
    .