Threaded View

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    15
    Vote Rating
    0
    kef4e is on a distinguished road

      0  

    Default Answered: MVC event bubbling - bug or is it just me ?

    Answered: MVC event bubbling - bug or is it just me ?


    Hi,

    I am not sure if this is a bug, or it is just me, so I will post here just in case

    Until recently I used ExtJS 4.02a to create an MVC app. I uprated to 4.07, and a strange bug appeared.

    In my app there is event bubbling , so that when a field is changed within a form the form is notified. I was controlling this event from the Controller like this:

    Code:
    this.control({
       'app_formpanel': {
             change: function (p){    
                 // do something
    
              }
       }
    });
    however,

    after the upgrade this doesn't work,

    I have to control the bubble event like this:

    Code:
    this.control({
       'app_formpanel': {
             afterrender: function (p){    
                 p.on('change',function (){
                          // do something
                 });
                  
              }
       }
    });
    Is there any specific reason why in 4.07, handling bubbled events must be done by appending an event handled after render, and not just as regular events (in MVC)?
    Is it just me or is this a bug ? Did somebody else encounter this after using 4.07 ?

    p.s. I apologize for posting this twice, but I think here is a better place to ask this question, than the 'Discussions'. The moderators can delete the thread in 'Discussions'. 10x

  2. Code:
    this.control({
        'app_formpanel field' : {
            change: someFunction
        }
    });
    What this does is gets all 'field's within 'app_formpanel' so since textfield, combobox, etc eventually extend field, this ComponentQuery will listen for the change event on those fields (all subclasses of field).

Thread Participants: 1