Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-4264 in a recent build.
  1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    135
    Vote Rating
    1
    DiscoBoy is on a distinguished road

      0  

    Exclamation Bug in relayEvents together with prefix

    Bug in relayEvents together with prefix


    I just noted that the relayEvents function in util.Observable fails if I provide a prefix for the relayed event. Normally I would assume that the prefix is simply added to the old event name, for instance like this:

    Code:
    relayed event = "load"
    prefix = "layers"
    --> new event = "layersload"
    In fact the function substrings the old event name by the length of the prefix which makes absolutely no sense, or?

    Code:
        relayEvents : function(origin, events, prefix) {
            prefix = prefix || '';
            var me = this,
                len = events.length,
                i = 0,
                oldName,
                newName;
    
            for (; i < len; i++) {
                oldName = events[i].substr(prefix.length);
                newName = prefix + oldName;
                me.events[newName] = me.events[newName] || true;
                origin.on(oldName, me.createRelayer(newName));
            }
        }

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,949
    Vote Rating
    636
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Yeah, something's gone wrong there. Thanks for the report.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1