I am very new to the programming. I have an aiu-select2 box with multiple options as selected. At some point I need to deselect a particular option from the selection and need to replace it with new option using Java Script.
Hi Sabin,
aui-select2 is based on Select2 version 3.x, so you can see the documentation for that here: http://select2.github.io/select2/
If you can't figure out how to remove one particular option, you may have to get all values into a list, remove the value you don't want, add the new one, and then set the value of the select2 with the new list of values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use AJS.$("#resourcesDropdown").auiSelect2('val','');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ahhhhhhhh! Now I found the correct solution on http://select2.github.io/select2/
:D
When placeholder is used for a non-multi-value select box, it requires that you include an empty
<option></option>
tag as your first option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.