1.2 KiB
1.2 KiB
title | taxonomy | ||
---|---|---|---|
Array |
|
Array
Select2 allows creating the results based on an array of data objects that is included when initializing Select2.
- Key
data
<dt>Value</dt>
<dd>array of objects</dd>
</dl>
</div>
<div class="col-sm-6">
<dl class="dl-horizontal">
<dt>Adapter</dt>
<dd>
<code title="select2/data/array">ArrayAdapter</code>
</dd>
</dl>
</div>
The objects that the users can select from should be passed as an array
with each object containing id
and text
properties.
Select2 provides the SingleSelection
and MultipleSelection
adapters as default implementations of the SelectionAdapter
for single- and multi-select controls, respectively. Both SingleSelection
and MultipleSelection
extend the base BaseSelection
adapter.
The selection adapter can be overridden by assigning a custom adapter to the selectionAdapter
configuration option.