-
18 Dec 2011 8:12 AM #1
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.
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.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' //
-
19 Dec 2011 7:36 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
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.
-
12 Jan 2012 3:34 PM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
This has been fixed for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1292
in
2.0.



Reply With Quote