Select2 multiselect sort problem


#1

Hello,

In Select2 multi-select component how can I prevent sort alphabetically.

For Example.First I select Augrabies then Auckland.
But it shows me Auckland first and then Augrabies

How can I override this behavior ?

Thank you.


#2

Not sure if I understand your question. Isn’t Auckland displays first then Augrabies so your current display is correct.


#3

No not correct.

if I select “B” and then “A”, the multi select should display “B”, “A” and not “A”, “B”


#4

can you show me any code on this? or your site link


#5

http://keenthemes.com/preview/metronic/theme/admin_5_rounded/components_select2.html

go for “Select2 multi select”


#6

select2 jquery works like that. In your dropdown example.

  1. Alaska
  2. Hawaii

then you select Hawaii so it will display 2nd because in the dropdown list it is 2nd and then if you select Alaska it displays 1st.


#7

Yes I know that but what if I want to override that behavior.


#8

try reading these links



just try, it might help you. Though I never tried it :slight_smile:

Thanks