Guys, any ideas how to do this? This is a real show-stopper for select2!
I'll have to switch to other implementations of drop-down lists if I don't find the solution in the nearest couple of days. It is really annoying that initSelection was removed in v4.0 and no working samples provided for the alternative... :(
--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To post to this group, send email to sel...@googlegroups.com.
Visit this group at http://groups.google.com/group/select2.
For more options, visit https://groups.google.com/d/optout.
What?
The select2 site has a description of how to do this.
https://select2.org/programmatic-control/add-select-clear-items#preselecting-options-in-an-remotely-sourced-ajax-select2
I did this on my MVC application. User selects value in select2 and submits. on Reload the parameter value is passed back to the page. If the parameter has a value, then I call the functioned referenced to add it and trigger the select2 object.