Results 1 to 3 of 3

Thread: [FIXED][3.0] relayEvents disables events

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default [FIXED][3.0] relayEvents disables events

    The current relayEvents method inadvertently disables already registered event handlers.

    Example:
    Create a FormPanel with an actioncomplete listener.
    The addListener call will initialize events['actioncomplete'] (set it to an Ext.util.Event instance).
    The relayEvents call to relay beforeaction, actioncomplete and actionfailure events from the BasicForm will toggle events['actioncomplete'], setting it to false.

    Fix:
    Code:
    Ext.override(Ext.util.Observable, {
        relayEvents: function(o, events){
            var me = this;
            function createHandler(ename){
                return function(){
                    return me.fireEvent.apply(me, [ename].concat(Ext.toArray(arguments)));
                };
            };
            Ext.each(events, function(ename){
                me.events[ename] = me.events[ename] || true;
                o.on(ename, createHandler(ename), me);
            });
        }
    });

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,608
    Vote Rating
    874
      0  

    Default

    Fixed in SVN.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408
    Vote Rating
    9
      0  

    Default

    Ah, great. I fixed this a while back by copying over the code from v2.2.

    Note that
    PHP Code:
    o.on(enamecreateHandler(ename), me); 
    can be shortened to
    PHP Code:
    o.on(enamecreateHandler(ename)); 
    since me is used instead of this and it references inside the closure. A big three bytes, but it would be nice if I didn't have so many files marked as changed from the svn trunk! Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •