"Select2" means: http://ivaynberg.github.io/select2/
Now, my question is: I have hard coded source for the select2 widget, for example:
<select>
<option value = "1">A</option>
<option value = "2">B</option>
<option value = "3">C</option>
</select>
Then, when I choose A and B two options, and use:
var result = $("#id").select2("val");
I can get the result is equal to A,B. So next when I want to reload the result:
$("#id").select2("val", result);
it can not succeed, because the widget cannot separate they are two different options.
How can I solve that problem, cannot use split(",")
command, because maybe some options have a comma.