Check out this Select2 jQuery plugin widget – a Yii 2. It supports searching, infinite scrolling of results and remote data sets. This widget is mostly styled for Bootstrap 3. If the current visitor’s browser does not support JQuery field will fall back to HTML select or text input. You can setup model validation rules for a model attribute that uses Select2 widget for input like any other field.
In the latest release there are new functionalities covered.
themeproperty which allows you to define themes in Select2 for styling your widget.
Select2::THEME_KRAJEEwhich is specially styled for yii2-widget-select2. This theme matches the bootstrap 3 styling with various enhancements.
Select2::THEME_BOOTSTRAP. You can now add your own custom theme and modify configuration of the widget
queryplugin property is no more needed. It is also not necessary to configure
data, not even if you have not set
ajax. Widget will automatically evaluate properties and default values.
initSelectionmethod of Select2 3.5.x plugin is removed. New
initValueTextproperty has been provided with the Select2 widget to cover this (e.g. for ajax based loading).