I have been using this third party plugin by Ivan Vaynberg and have found an issue. While using multiselect in select2 I find that the select2("val") is returning the selected values in sorted order and is not reflecting the order of element selections although select2("data") does give the selections in order. Also it seems it is a reported bug in the github but strangely there has been no response from the third party. https://github.com/ivaynberg/select2/issues/1861
Is there anyone who has faced similar problem and has a solution for this?
Also is there anyway of implementing sortResults on select options with multiple attribute (multiselect basically) because it seems that sortResults only works for the input search bar provided in the single selects.
Thanks.
I had tried various workaround but it seems the only way we can counter this for now is by making changes on the server side. What I did was to send the options as inputs (in order by appending an input every time an option is selected) in the form to the server side and process those inputs for the database. And as a result I got the options sorted on the client side when I made the request for the options again.
SortResults do work with multiple. I found out it later that my select was getting reinitialized by a redundant code which is why my sortResult attribute wasn't working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With