mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2025-03-14 21:42:21 +00:00
This commit is contained in:
parent
f73c77905a
commit
e33cfc8a7f
13
dist/jquery.autocomplete.js
vendored
13
dist/jquery.autocomplete.js
vendored
@ -53,6 +53,7 @@
|
||||
var noop = function () { },
|
||||
that = this,
|
||||
defaults = {
|
||||
ajaxSettings: {},
|
||||
autoSelectFirst: false,
|
||||
appendTo: document.body,
|
||||
serviceUrl: null,
|
||||
@ -521,7 +522,8 @@
|
||||
options = that.options,
|
||||
serviceUrl = options.serviceUrl,
|
||||
params,
|
||||
cacheKey;
|
||||
cacheKey,
|
||||
ajaxSettings;
|
||||
|
||||
options.params[options.paramName] = q;
|
||||
params = options.ignoreParams ? null : options.params;
|
||||
@ -546,12 +548,17 @@
|
||||
if (that.currentRequest) {
|
||||
that.currentRequest.abort();
|
||||
}
|
||||
that.currentRequest = $.ajax({
|
||||
|
||||
ajaxSettings = {
|
||||
url: serviceUrl,
|
||||
data: params,
|
||||
type: options.type,
|
||||
dataType: options.dataType
|
||||
}).done(function (data) {
|
||||
};
|
||||
|
||||
$.extend(ajaxSettings, options.ajaxSettings);
|
||||
|
||||
that.currentRequest = $.ajax(ajaxSettings).done(function (data) {
|
||||
var result;
|
||||
that.currentRequest = null;
|
||||
result = options.transformResult(data);
|
||||
|
@ -13,6 +13,7 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
|
||||
* Sets up autocomplete for input field(s).
|
||||
* `options`: An object literal which defines the settings to use for the autocomplete plugin.
|
||||
* `serviceUrl`: Server side URL or callback function that returns serviceUrl string. Optional if local lookup data is provided.
|
||||
* `ajaxSettings`: Any additional [Ajax Settings](http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings) that configure the jQuery Ajax request.
|
||||
* `lookup`: Lookup array for the suggestions. It may be array of strings or `suggestion` object literals.
|
||||
* `suggestion`: An object literal with the following format: `{ value: 'string', data: any }`.
|
||||
* `lookupFilter`: `function (suggestion, query, queryLowerCase) {}` filter function for local lookups. By default it does partial string match (case insensitive).
|
||||
|
Loading…
x
Reference in New Issue
Block a user