diff --git a/select2-latest.html b/select2-latest.html index 219feee8..38c68bb4 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -223,6 +223,7 @@ $("#e10_3").select2({
  • change event now specifies which elements were added/removed
  • 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.
  • @@ -560,6 +561,7 @@ $(document).ready(function() { $("#e8").select2(); $("#e8_get").click(function () { alert("Selected value is: "+$("#e8").select2("val"));}); $("#e8_set").click(function () { $("#e8").select2("val", "CA"); }); +$("#e8_cl").click(function() { $("#e8").select2("val", ""); }); $("#e8_get2").click(function () { alert("Selected data is: "+JSON.stringify($("#e8").select2("data")));}); $("#e8_set2").click(function () { $("#e8").select2("data", {id: "CA", text: "California"}); }); $("#e8_open").click(function () { $("#e8").select2("open"); }); @@ -569,6 +571,7 @@ $("#e8_2_get").click(function () { alert("Selected value is: "+$("#e8_2").select $("#e8_2_set").click(function () { $("#e8_2").select2("val", ["CA","MA"]); }); $("#e8_2_get2").click(function () { alert("Selected value is: "+JSON.stringify($("#e8_2").select2("data")));}); $("#e8_2_set2").click(function () { $("#e8_2").select2("data", [{id: "CA", text: "California"},{id:"MA", text: "Massachusetts"}]); }); +$("#e8_2_cl").click(function() { $("#e8_2").select2("val", ""); }); $("#e8_2_open").click(function () { $("#e8_2").select2("open"); }); $("#e8_2_close").click(function () { $("#e8_2").select2("close"); }); }); @@ -579,6 +582,7 @@ $("#e8_2_close").click(function () { $("#e8_2").select2("close"); });

    + @@ -592,7 +596,8 @@ $("#e8_2_close").click(function () { $("#e8_2").select2("close"); }); - + +

    @@ -1192,8 +1197,8 @@ $("#tags").select2({ Attached to input[type=hidden] - An object representing the selection. Should at least contain an id key. The rest of the keys should be determined by the custom rendering function, the default rendering function only needs an additional text key - An array of objects representing the selection. null for empty. + Id of the object that should be selected. "" to clear. Can only be used if initSelection() was specified. + An array of objects ids that should be selected. "" to clear. Can only be used if initSelection() was specified. diff --git a/select2-master b/select2-master index b672d760..11652890 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit b672d760acec620681d95377262b93e52d96bae1 +Subproject commit 116528908a125b8f63d6ec53af0fe8cdc8a18c8e