Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1292 in 2.0.
  1. #1
    Sencha User demongloom's Avatar
    Join Date
    Apr 2008
    Location
    Israel
    Posts
    30
    Vote Rating
    1
    demongloom is on a distinguished road

      0  

    Default Events and 'before' option

    Events and 'before' option


    Hello,

    I've found bug which happens when I have multiple listeners for the same event. There are reproduce steps to simulate it.

    Code:
    // Initializing our test callbacks
    var test = { fn: function() { console.log('hi'); }, scope: {}, opts: {} };
    var test_before = { fn: function() { console.log('before hi'); }, scope: {}, opts: {} };
    
    
    // Binding first callback
    Ext.getBody().on('click', test.fn, test.scope, test.opts);
    
    
    
    
    
    
    //
    // clicking on the body -> 'hi'
    //
    
    
    
    
    // Binding 'before' callback
    Ext.getBody().on('click', test_before.fn, test_before.scope, test_before.opts, 'before');
    
    
    
    
    //
    // clicking on the body -> 'before hi', 'hi'
    //
    
    
    
    
    
    
    // Unbinding 'before' callback
    Ext.getBody().un('click', test_before.fn, test_before.scope, test_before.opts, 'before');
    
    
    
    
    //
    // clicking on the body -> nothing happens !!!
    //
    
    
    
    
    
    // Binding 'before' callback
    Ext.getBody().on('click', test_before.fn, test_before.scope, test_before.opts, 'before');
    
    
    
    
    //
    // clicking on the body -> 'before hi', 'hi'
    //
    Using debugger I found the problem inside Ext.event.publisher.Dom.unsubscribe function. It's don't take into attention event ordering parameters, so when 'before' event is detached it's also affects on regular events.


  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,121
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Thank you for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  3. #3
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,659
    Vote Rating
    14
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This has been fixed for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins