PDA

View Full Version : [FIXED] [4.1.x] Suggestion: Enhancement for listener binding



willydee
5 Nov 2012, 7:16 PM
Since the topic was not picked up by any developer, and is locked now in the now read-only forum, I post a pointer to it here:

http://www.sencha.com/forum/showthread.php?206019-Ext-4.1.x-Proposal-for-listeners-enhancement

Please consider integrating this suggestion into a near release, minor but very useful, and unlikely to break existing code. A lot of code related to event binding could be saved.

No bug reporting template used, since it's a feature suggestion, not a bug.

Animal
7 Nov 2012, 11:12 AM
The code in Observable now has



if (typeof fn === 'string') {
scope = scope || me;
//<debug>
if (!(scope[fn])) {
Ext.Error.raise('No method named "' + fn + '"');
}
//</debug>
fn = scope[fn];
}


As you can see, it now uses the scope as the object from which to access the named function, and that defaults to the current object if not specified, so I think your use case will work when 4.2 comes out.