

When attached to a select resolves the option that should be used as the placeholder.Ĭan either be a function which given the select element should return the optionĮlement or a string first to indicate that the first option should be used. Is selected in non-multi-value select boxes an empty first option element must be provided ( ) Note that because browsers assume the first option element Or input element that Select2 is attached to.

The placeholder can also be specified as a data-placeholder attribute on the select Initial value that is selected if no other selection is made. Once the number of selected items reaches the maximum specified the contents of the dropdown will be populated If this number is less than 1 selection is not limited. The maximum number of items that can be selected in a multi-select control. Only applies to single-value select boxes The option can be set to a negative value to permanently hide the search field. Is not very useful and wastes screen space. Is useful for cases where local data is used with just a few results, in which case the search box Populated in order to keep the search field. The minimum number of results that must be initially (after opening the dropdown for the first time) Maximum number of characters that can be entered for an input. Number of characters necessary to start a search. other values if the width attribute contains a function it will be evaluated, otherwise the value is used verbatim. resolve First attempts to copy than falls back on element. copy Copies the value of the width style attribute set on the source element.

element Uses javascript to calculate the width of the source element. Keep in mind that the container div copies classes from the source element so setting the width attribute may not always be necessary. Controls the width style attribute of the Select2 container div.
