From f7d75b62fa745a9cc885e1b1758f6599be035dd5 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Tue, 9 Dec 2014 22:02:16 -0500 Subject: [PATCH] Added more documentation This adds documentation for a `dropdownParent` option which has not yet been created, but will come in the next commit. --- docs/_includes/head.html | 3 +- docs/examples.html | 6 +- docs/options.html | 194 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 197 insertions(+), 6 deletions(-) diff --git a/docs/_includes/head.html b/docs/_includes/head.html index c2366908..58a826a2 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -17,6 +17,7 @@ diff --git a/docs/examples.html b/docs/examples.html index 919e096c..59ca4ad4 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -372,9 +372,9 @@ $(".js-example-tags").select2({

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.

diff --git a/docs/options.html b/docs/options.html index f63e9bc3..d3cb32a7 100644 --- a/docs/options.html +++ b/docs/options.html @@ -86,6 +86,8 @@ $.fn.select2.amd.require(
Decorator
Placeholder + and + HidePlaceholder
@@ -108,6 +110,10 @@ $.fn.select2.amd.require( placeholders.

+
+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"
+}
+
+
- You pass in an object when you are using a framework that - creates its own placeholder option. The + You should pass in an object when you are using a + framework that creates its own placeholder option. The id should be the same as the value attribute on the option.
+

+ You can allow a selected option to be cleared back to the placeholder by + enabling the allowClear option. +

+ +
+
+
+
Key
+
allowClear
+ +
Value
+
boolean
+
+
+ +
+
+
Adapter
+
+ SelectionAdapter +
+ +
Decorator
+
+ 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. +

+ +

+ Multiple selections +

+ +

+ Select2 can display either a single selection or multiple selections. +

+ +
+
Key
+
multiple
+ +
Value
+
boolean (true or false)
+
+ + This option will determine what the 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. +

Internationalization (Language support)

@@ -369,6 +440,125 @@ ajax: {

+ +