1
0
mirror of synced 2025-02-03 21:59:24 +03:00

catch up to master

This commit is contained in:
Igor Vaynberg 2013-03-14 14:01:17 -07:00
parent 91f79fb597
commit 94585c63ef
3 changed files with 24 additions and 6 deletions

View File

@ -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"); });
<input type="button" class="btn-warning" id="e8_2_close" value="Close"/>
</p>
<p>
<select id="e8_2" multiple style="width:300px" class="populate"></select><br/>
<select id="e8_2" multiple style="width:300px" class="populate"><option></option></select><br/>
</p>
</div>
<div class="span8">
@ -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)");});
});
</script>
<div class="span4">
@ -1629,6 +1631,19 @@ $("#select").select2({
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>loaded</h3>
<p>Fired when query function is done loading the data and the results list has been updated</p>
</p>
<p>The event object contains the following custom properties:
<dl>
<dt>data</dt><dd>data that was used to populate the results</dd>
</dl>
</p>
</div>
</div>
</section>

@ -1 +1 @@
Subproject commit fb158ed0c87bc0936d1fa43d88cf89cafa6bf845
Subproject commit 9acfc6faa5448730cb5e82f2277b80080df3d7f5

View File

@ -20,6 +20,7 @@
<option value="NV">Nevada</option>
<option value="OR">Oregon</option>
<option value="WA">Washington</option>
<!--
<option value="AK1">Alaska</option>
<option value="HI1">Hawaii</option>
<option value="CA1">California</option>
@ -31,6 +32,7 @@
<option value="NV2">Nevada</option>
<option value="OR2">Oregon</option>
<option value="WA2">Washington</option>
-->
</select><br/>
<input type="text" size="30"/>
</div>
@ -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
});
});