Threaded View

  1. #1
    Sencha User
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    13
    Vote Rating
    0
    Intraday is on a distinguished road

      0  

    Default Answered: Newbie questions

    Answered: Newbie questions


    Hello,
    Ext JS is something new for me. I hope someone answer my questions.
    1. What is the different between this.control and this.application.on within ths init:function inside a controller file?
    2. If I have different panels with buttons inside a viewport, how do you catch the events for the different button-pushes from the views inside the controller?
    3. If I have three different fields within same panel, how can I use the same change-listener for all the three fields?
    Thanks in advance

  2. 1.
    this.application.on:
    listen to events fired by your application, it's mostly used for firing an event in a controller:

    Code:
    this.application.fireEvent('blaaa');
    and listen to it on another controller, this will be replaced in ExtJs 4.2 there you can use this.control for it =)

    this.control: can listen to nearly everything with the help of a selector

    2.
    The common way is to give the buttons an action:

    Code:
    //... Button config... bla
    action: 'user-create';
    then listen to it in the controller:

    Code:
     this.control({
                'button[action=user-create]': {
                    click: this.createUserAction
                }
    });
    3.
    Just call the same function o.O

    Code:
    
    
    Code:
     this.control({
                'textfield[itemId=user-email]': {
                    change: this.changeWhatever
                },
                'textfield[itemId=user-name]': {                change: this.changeWhatever
                },
                'textfield[itemId=user-passwd]': {
                    change: this.changeWhatever
                },
    });



Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar