简体   繁体   中英

extjs4 get selected value from combobox

Ok, this is driving me nuts again. I am trying to get the selected value from a combo box so I can update a grid with the correct data based on the user selection. How do I do this?

I am using extjs 4 in MVC model. Here is my code:

my init inside the viewport:

init: function() {
    this.control({
        'viewport > combobox': {
            select: this.onChangeStacker
        }
    });
},

// method with pseudocode of what I want to do
onChangeStacker: function(){

    selected =  getSelection;


   switch selected

    case == stk1

         load stk1

    case == stk2 

         load stkd
}
});
this.control({
    'viewport > combobox': {
        change: function(cmp) {
            var value = cmp.getValue();
            .
            .
            .
        }
    }
});​

Documentation:

Working example: http://jsfiddle.net/kMs86/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM