From f7d75b62fa745a9cc885e1b1758f6599be035dd5 Mon Sep 17 00:00:00 2001
From: Kevin Brown
This custom matcher uses a
- compatibility module that is only
- bundled in the
- full version of Select2. You also
+ compatibility module that is
+ only bundled in the
+ full version of Select2. You also
have the option of using a
more complex matcher.
Placeholder
+ and
+ HidePlaceholder
+placeholder: "Select a repository", ++
If the value is an object, the object should be
compatible with Select2's internal objects. The id
should
@@ -116,13 +122,78 @@ $.fn.select2.amd.require(
when that option is selected.
+placeholder: { + id: "-1", + text: "Select a repository" +} ++
value
attribute on the option
.
+ You can allow a selected option to be cleared back to the placeholder by
+ enabling the allowClear
option.
+
allowClear
SelectionAdapter
+ AllowClear
+ + This will display an "x" that the user can click to clear the current + selection. It is designed to be used for cases where a single selection + can be made. +
+ ++ Select2 can display either a single selection or multiple selections. +
+ +multiple
true
or false
)SelectAdapter
(used by
+ default) should use to set the value of the underlying select
+ element. It will also determine if the MultipleSelection
+ adapter should be used.
+
+ Select2 allows you to change the way that the dropdown works, allowing you + to do anything from attach it to a different location in the document or + add a search box. +
+ ++ By default, Select2 will attach the dropdown to the end of the body and + will absolutely position it to appear below the selection container. +
+ +dropdownParent
DropdownAdapter
+ AttachBody
+ + When the dropdown is attached to the body, you are not limited to just + displaying the dropdown below the container. Select2 will display above + the container if there is not enough space below the container, but there + is enough space above it. You are also not limited to displaying the + drodown within the parent container, which means Select2 will render + correctly inside of modals and other small containers. +
+ ++ Select2 can place the dropdown directly after the selection cotainer, so + it will appear in the same location within the DOM as the rest of Select2. +
+ +DropdownAdapter
+ AttachContainer
+ + Users can filter down the results by typing a search term into a box that + is displayed at the top of the dropdown. +
+ +DropdownAdapter
+ DropdownSearch
+ + A search box is added to the top of the dropdown automatically for select + boxes where only a single option can be selected. +
+