1
0
mirror of synced 2024-11-23 21:36:09 +03:00
select2/pages/13.advanced/02.default-adapters/02.array/docs.md
2017-09-03 19:02:00 -04:00

1.2 KiB

title taxonomy
Array
category
docs

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.

Decorators