1. #1
    Sencha Premium Member
    Join Date
    Jan 2009
    Location
    France
    Posts
    10
    Vote Rating
    0
    aryl is on a distinguished road

      0  

    Default Unanswered: AddEvent / FireEvent any problem ?

    Unanswered: AddEvent / FireEvent any problem ?


    hello,

    While i was debuging an observable object, I took a look into the Ext.util.Observable source code.

    I notice the fireEvent method make a toLowercase before testing the events exitence.

    Code:
     
    fireEvent : function(eventName) {
            eventName = eventName.toLowerCase();
            var me = this, events = me.events,
           event = events && events[eventName], ret = true;
    
    
            // Only continue firing the event if there are listeners to be informed.
            // Bubbled events will always have a listener count, so will be fired.
            if (event && me.hasListeners[eventName]) {
                ret = me.continueFireEvent(eventName, Ext.Array.slice(arguments, 1), event.bubble);
            }
            return ret;
        },
    but in the addEvents methods the events array is populated without making a toLowerCase before

    Code:
    addEvents : function(o) {        
    var me = this, events = me.events || (me.events = {}), arg, args, i;
            if (typeof o == 'string') {
                for (args = arguments, i = args.length; i--;) {
                    arg = args[i];
                    if (!events[arg]) {
                        events[arg] = true;
                    }
                }
            } else {
                Ext.applyIf(me.events, o);
            }
        },

    So when i use the addEvent with event name containing some upper case caharacter i'm not abble to fire an event.

    Is it a bug or made I something wrong ?

    Thanks

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default Add events in lower case

    Add events in lower case


    Thats mean that all event should be added in lower case to be fired.

Thread Participants: 1

Tags for this Thread