diff --git a/select2-latest.html b/select2-latest.html index 9a692764..ffb9ffea 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -780,7 +780,7 @@ $("#tags").select2({ }); - + query function @@ -790,12 +790,14 @@ $("#tags").select2({ ParameterTypeDescription options.termstringSearch string entered by user options.pageint1-based page number tracked by Select2 for use with infinite scrolling of results - options.callbackfunction + options.contextobjectAn 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. + options.callbackfunction Callback function that should be called with the result object. The result object: +
ParameterTypeDescription
result.results[object]Array of result objects. The default renderers expect objects with id and text keys. The id attribute is required, even if custom renderers are used.
result.morebooleantrueif more results are available for the current search term
results.contextobjectA user-defined object that should be made available as the context parameter to the query function on subsequent queries to load more result pages for the same search term. See the description of options.context parameter.
@@ -810,7 +812,7 @@ $("#tags").select2({ transportfunctionFunction that will be used to perform the ajax request. Must be parameter-compatible with $.ajax. Defaults to $.ajax if not specified. Allows the use of various ajax wrapper libraries such as: AjaxManager. urlstringAjax url - dataTypestringtData type for the request. ajax, jsonp, other formats supported by jquery + dataTypestringData type for the request. ajax, jsonp, other formats supported by jquery quietMillisintNumber of milliseconds to wait for the user to stop typing before issuing the ajax request datafunction Function to generate query parameters for the ajax request. @@ -819,6 +821,7 @@ $("#tags").select2({ ParameterTypeDescription termstringSearch term pageint1-based page number tracked by Select2 for use with infinite scrolling of results + contextobjectSee options.context parameter to the query function above. <returns>objectObject containing url paramters @@ -829,6 +832,7 @@ $("#tags").select2({ ParameterTypeDescription dataobjectRetrieved data pageintPage number that was passed into the data function above + contextobjectSee options.context parameter to the query function above. <returns>objectResults object. See "options.callback" in the "query" function for format. diff --git a/select2-master b/select2-master index f3684641..c27880c1 160000 --- a/select2-master +++ b/select2-master @@ -1 +1 @@ -Subproject commit f368464132ea55f979693e4587603c1a84f75ee8 +Subproject commit c27880c19c90821138fe4e754a449f35a2ce9aa9