Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs Combo Box get previous value?

Trying to get the previous value of the combo box. I tried 'change' event, but it does not work. 'beforeselect' does not exist for the new extjs 4.0 if i am not wrong. Any ideas on how i can do this?

I understand we can use the change event, but that only happens when the user types something. I want to check if there is an previous value on each new select?

like image 468
shaoen01 Avatar asked Aug 17 '26 23:08

shaoen01


1 Answers

It's kind of weird that there is no beforeselect event. However, combobox extends picker and every picker has selectionModel with beforeselect event. So you may assign handler to picker selModel's beforeselect event:

MyCombo.getPicker().getSelectionModel()
    .on('beforeselect',function(sm, selections, i) {
        console.log(sm.lastSelected, selections, i);
    });
like image 76
Molecular Man Avatar answered Aug 20 '26 20:08

Molecular Man



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!