프로퍼티 |
타입 |
설명 |
|
$accesskey |
|
Implements open selector with accesskey |
|
$addon |
|
addon to prepend or append to the Select2 widget
- prepend: _array_|_string_, the prepend addon configuration. If set as a string will be rendered as is. If set
as an array, the following properties can be set:
- content: _string_, the prepend addon content.
- asButton: _boolean, whether the addon is a button or button group. Defaults to false.
- append: _array_|_string_, the append addon configuration. If set as a string will be rendered as is. If set
as an array, the following properties can be set:
- content: _string_, the append addon content.
- asButton: _boolean, whether the addon is a button or button group. Defaults to false.
- groupOptions: _array_, HTML options for the input group
- contentBefore: _string_, content placed before addon
- contentAfter: _string_, content placed after addon |
|
$changeOnReset |
|
whether to trigger change for Select2 input on form reset so the Select2 value is rightly reset. |
|
$data |
array |
the option data items. The array keys are option values, and the array values are the
corresponding option labels. The array can also be nested (i.e. some array values are arrays too). For each
sub-array, an option group will be generated whose label is the key associated with the sub-array. If you
have a list of data models, you may convert them into the format described above using [[ArrayHelper::map()]]. |
|
$hideSearch |
|
whether to hide the search control and render it as a simple select. |
|
$initValueText |
|
|
|
$language |
|
the locale ID (e.g. 'fr', 'de') for the language to be used by the Select2 Widget. If this property
not set, then the current application language will be used. |
|
$maintainOrder |
|
whether to maintain the order of tag / option selected for a multiple select |
|
$options |
|
the HTML attributes for the input tag. The following options are important:
- multiple: _boolean_, whether multiple or single item should be selected. Defaults to false.
- placeholder: _string_, placeholder for the select item. |
|
$pluginName |
|
the name of the jQuery plugin |
|
$showToggleAll |
|
whether to show the toggle all button for selection all options in a multiple select. |
|
$size |
|
Size of the Select2 input, must be one of the [[Select2::LARGE]], [[Select2::MEDIUM]] or
[[Select2::SMALL]]. |
|
$theme |
|
the theme name to be used for styling the Select2. |
|
$toggleAllSettings |
|
the toggle all button settings for selecting/unselecting all the options. This is applicable only for
multiple select. The following array key properties can be set:
- selectLabel: _string_, the markup to be shown to select all records. Defaults to:
Select all.
- unselectLabel: _string_, the markup to be shown to unselect all records. Defaults to:
Unselect all.
- selectOptions: _array_, the HTML attributes for the container wrapping the select label. Defaults to [].
- unselectOptions: _array_, the HTML attributes for the container wrapping the unselect label. Defaults to [].
- options: _array_, the HTML attributes for the toggle button container. Defaults to:
['class' => 's2-togall-button']. |
|