diff --git a/index.html b/index.html index e2e12978..e84c79aa 100644 --- a/index.html +++ b/index.html @@ -303,7 +303,8 @@ $("#e10_4").select2({

The Basics

-

Select2 can take a regular select box like this:

+ +

-

and turns it into:

+

@@ -392,7 +393,9 @@ $("#e10_4").select2({

Multi-Value Select Boxes

-

Select2 also supports multi-value select boxes. The select below is declared with the multiple attribute. Select2 automatically picks up on this:

+

Select2 also supports multi-value select boxes. The select below is declared with the multiple attribute.

+ +

@@ -418,12 +421,12 @@ $("#e2_2").select2({ });
-

Placeholders

+

A placeholder value can be defined and will be displayed until a selection is made:


-

+


The placeholder can be declared via a data-placeholder attribute attached to the select, or via the placeholder configuration element as seen in the example code.

@@ -440,9 +443,10 @@ $("#e2_2").select2({
-

Minimum Input

+

Select2 supports a minimum input setting which is useful for large remote datasets where short search terms are not very useful:

+

@@ -454,7 +458,7 @@ $("#e2_2").select2({
-

Templating

+

Various display options of the Select2 component can be changed:


@@ -506,9 +510,10 @@ $("#e19").select2({ maximumSelectionSize: 3 });

-

Maximum Selection Size

+

Select2 allows the developer to limit the number of items that can be selected in a multi-select control. In the example below only 3 or less items can be selected.

+

@@ -601,8 +606,9 @@ $("#e8_2_close").click(function () { $("#e8_2").select2("close"); }); });
-

Programmatic Access

+

Select2 supports methods that allow programmatic control of the component:

+

@@ -624,6 +630,8 @@ $("#e8_2_close").click(function () { $("#e8_2").select2("close"); });

+ +


@@ -775,11 +783,12 @@ $("#e13_ak_co").click(function() { $("#e13").val(["AK","CO"]).trigger("change"); });
-

Reacting to external value changes

+

Select2 can react to external value changes and keep its selection in-sync. This feature allows Select2 to work seamlessly with front-end frameworks that use data binding between ui components and model values.

+


This feature is only available when initSelection() function is provided in @@ -803,7 +812,7 @@ $("#e14_destroy").click(function() { $("#e14").select2("destroy"); }); });

-

Select2 Lifecycle

+

@@ -861,8 +870,11 @@ $("#e16_writable").click(function() { $("#e16,#e16_2").select2("readonly", false });

-

Select2 Disabled Mode

+

+


+ +


@@ -893,10 +905,13 @@ $("#e17_2").select2({ });
-

Custom Matcher

+

Unlike other dropdowns on this page, this one matches options only if the term appears in the beginning of the string as opposed to anywhere:

+


-

The dropdown below matches on custom attributes of the option tag. For example, the `blue` option can be matched by entering either `blue` or `cyan`:

+

The dropdown below matches on custom attributes of the option tag.

+ +

@@ -929,7 +944,7 @@ $('#e22').select2({ });
-

Sorting Displayed Results

+

Unlike other dropdowns on this page, this one filters results by query string normally, but returns the matched results sorted from shortest to longest by string length. Try typing 'e' and seeing how the results are sorted. This function is useful for sorting results by relevance to a user's query.


+ +


Select2 will do its best to resolve the percent width specified via a css class, but it is not always possible. The best way to ensure that Select2 is using a percent based width is to inline the style declaration into the tag.

@@ -1050,8 +1068,9 @@ $(document).ready(function () {
-

Diacritics Support

+

Select2's default matcher will ignore diacritics, making it easier for users to filter results in international selects. Type "aero" into the select below:

+