Reacting to external value changes
+ +Select2 can react to external value changes and keep its selection in-sync. This feature allows + Select2 to work seamlessly with front-end frameworks that use data binding between ui components + and model values.
++
This feature is only available when initSelection() function is provided in
+ the options. This function is needed to map the choice ids set on the element to objects used by
+ Select2. This function is set by default when Select2 is attached to a select
or when
+ the tags
helper function is used.
Example Code
+++