diff --git a/select2-latest.html b/select2-latest.html index 2b74608a..dc31dfc3 100644 --- a/select2-latest.html +++ b/select2-latest.html @@ -580,7 +580,7 @@ $("#e8_get2").click(function () { alert("Selected data is: "+JSON.stringify($("# $("#e8_set2").click(function () { $("#e8").select2("data", {id: "CA", text: "California"}); }); $("#e8_open").click(function () { $("#e8").select2("open"); }); $("#e8_close").click(function () { $("#e8").select2("close"); }); -$("#e8_2").select2(); +$("#e8_2").select2({placeholder: "Select a state"}); $("#e8_2_get").click(function () { alert("Selected value is: "+$("#e8_2").select2("val"));}); $("#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")));}); @@ -615,7 +615,7 @@ $("#e8_2_close").click(function () { $("#e8_2").select2("close"); });

-
+

@@ -649,7 +649,8 @@ $("#e11") .on("close", function() { log("close"); }) .on("highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("selected", function(e) { log ("selected val="+ e.val+" choice="+ JSON.stringify(e.choice));}) - .on("removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}); + .on("removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}) + .on("loaded", function(e) { log ("loaded (data property omitted for brevitiy)");}); $("#e11_2") .on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) .on("opening", function() { log("opening"); }) @@ -657,7 +658,8 @@ $("#e11_2") .on("close", function() { log("close"); }) .on("highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}) .on("selected", function(e) { log ("selected val="+ e.val+" choice="+ JSON.stringify(e.choice));}) - .on("removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}); + .on("removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}) + .on("loaded", function(e) { log ("loaded (data property omitted for brevitiy)");}); });
@@ -1629,6 +1631,19 @@ $("#select").select2({

+
+
+

loaded

+

Fired when query function is done loading the data and the results list has been updated

+

+

The event object contains the following custom properties: +

+
data
data that was used to populate the results
+
+

+
+
+ diff --git a/select2-master b/select2-master index fb158ed0..9acfc6fa 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit fb158ed0c87bc0936d1fa43d88cf89cafa6bf845 +Subproject commit 9acfc6faa5448730cb5e82f2277b80080df3d7f5 diff --git a/select2-test.html b/select2-test.html index 1e47e609..9c537441 100644 --- a/select2-test.html +++ b/select2-test.html @@ -20,6 +20,7 @@ +
@@ -95,7 +97,7 @@ $("#e6").select2({ placeholder: "Search for a movie", minimumInputLength: 1, - multiple:true, + multiple:false, ajax: { // instead of writing the function to execute the request we use Select2's convenient helper url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', @@ -128,6 +130,7 @@ formatResult: movieFormatResult, // omitted for brevity, see the source of this page formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller + formatSearching: function() {return "Searching...";}, escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results }); });