diff --git a/select2-latest.html b/select2-latest.html index 3a4341ca..cd648c2b 100644 --- a/select2-latest.html +++ b/select2-latest.html @@ -636,6 +636,7 @@ $("#e11") .on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) .on("opening", function() { log("opening"); }) .on("open", function() { log("open"); }) + .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));}); @@ -643,6 +644,7 @@ $("#e11_2") .on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) .on("opening", function() { log("opening"); }) .on("open", function() { log("open"); }) + .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));}); @@ -1317,6 +1319,7 @@ $("#tags").select2({
query(options)
Parameter | Type | Description |
---|---|---|
options.element | jquery object | The element Select2 is attached to |
options.term | string | Search string entered by user |
options.page | int | 1-based page number tracked by Select2 for use with infinite scrolling of results |
options.context | object | An object that persists across the lifecycle of queries for the same search term (the query to retrieve the initial results, and subsequent queries to retrieve more result pages for the same search term). When this function is first called for a new search term this object will be null. The user may choose to set any object in the results.context field - this object will then be used as the context parameter for all calls to the query method that will load more search results for the initial search term. The object will be reset back to null when a new search term is queried. This feature is useful when a page number is not easily mapped against the server side paging mechanism. For example, some server side paging mechanism may return a "continuation token" that needs to be passed back to them in order to retrieve the next page of search results. |