1
votes

Maybe someone can help me to sort selected items. By default new selected is added to the end of array.

I would like to show them alphabetically, is it possible to do?

I tried to set some listeners on change but this event is called after selected item is shown on the component.

Any help, or sugestion?

1

1 Answers

3
votes

I just did this today!

Add a listener on select, and sort them there:

...                     
"listeners": {
    "select": function(combo, records){
        records.sort(function(a, b){
            //Change value to text or whatever field you want to sort on
            return a.data.value - b.data.value; 
        });
        combo.setValue();
        combo.setValue(records);
    }
},
...

Cheers