From 7a24555d66c430cec5c306f6d4598516570aa5e1 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 27 Jul 2012 16:39:04 +0300 Subject: [PATCH] catch up to master --- select2-latest.html | 59 ++++++++++++++++++++++++++++++++++++++------- select2-master | 2 +- 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/select2-latest.html b/select2-latest.html index 37b27006..febf2cd5 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -13,6 +13,7 @@ version: 3.0 $(function() { var opts=$("#source").html(), opts2=""+opts; $("select.populate").each(function() { var e=$(this); e.html(e.hasClass("placeholder")?opts2:opts); }); + $(".examples article:odd").addClass("zebra"); }); $(document).ready(function() { @@ -231,6 +232,7 @@ $("#e10_3").select2({
  • width option now supports various strategies instead of always being copied from the source element
  • Clicks on a label associated with the source element are now redirected to Select2.
  • val will now only accept ids, if you want to specify the full object for the selection use the new data method instead. val will also now only work on non-selects if initSelection was specified.
  • +
  • It is now possible to limit the number of options that can be selected in a multi-select component. See the Maximum Selection Size example
  • @@ -246,7 +248,7 @@ $("#e10_3").select2({ -
    +

    Examples

    @@ -344,7 +346,7 @@ $("#e10_3").select2({
    -
    +

    Multi-Value Select Boxes

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

    @@ -392,7 +394,7 @@ $("#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:

    @@ -436,7 +438,7 @@ $("#e2_2").select2({
    -
    +

    Loading Data

    Select2 uses a function to load result data. Here is a trivial example that creates choices that consist of user's input repeated a number of times:

    @@ -452,6 +454,28 @@ $("#e2_2").select2({
    + + +
    +
    +

    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.

    +

    + +

    +
    +
    +

    Example Code

    +
    +            
    +
    +
    +

    Loading Array Data

    @@ -476,7 +500,7 @@ $("#e2_2").select2({
    -
    +

    Loading Remote Data

    Select2 comes with AJAX/JSONP support built in. In this example we will search for a movie using Rotten Tomatoes API:

    @@ -506,7 +530,7 @@ $("#e2_2").select2({
    -
    +