I am trying to use select2 with one disabled value.
I am trying to implement it like
$('#select_currency').select2('data', preloaded_data);
I have been reading about Lock selections but I am not able to implement it, could you please someone let me know how to implement it or is there any tutorial about it.
You can easely add locked="locked"
if you use v3.5 http://select2.github.io/select2/#locked-selections.
But in v.4.x this functionality is removed.
I've found solution (or hack:) ) for v.4.x, a little bit dirty with error in console, but it works. Anyway it is best solution what I've found. Check my jsfiddle:
https://jsfiddle.net/o3s3y42e/4/
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