Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  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).

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Answers
    3447
    Vote Rating
    813
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Why not just setup a ComponentQuery to listen for the change event? No need to bubble.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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

      0  

    Default


    Hi,

    Thanks for the answer. I am not quite sure what you mean by setting up a ComponentQuery to listen.
    Could you please give me some hints on this ?

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Answers
    3447
    Vote Rating
    813
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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).
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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

      0  

    Default


    Ahaa, yep, this is a good idea ! I usually avoid assigning events to multiple components in this manner, because it might result in unwanted behavior.

    10x again.

Thread Participants: 1