2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-09 23:01:00 +00:00

add the ajaxSetter option

provide a way to rearange the settings of the ajax request just before
sending the request.
This commit is contained in:
Marc Chantreux 2016-10-27 14:54:57 +02:00
parent 017965bddd
commit f7e87a0979

View File

@ -56,6 +56,7 @@
that = this,
defaults = {
ajaxSettings: {},
ajaxSetter: null,
autoSelectFirst: false,
appendTo: document.body,
serviceUrl: null,
@ -594,6 +595,9 @@
$.extend(ajaxSettings, options.ajaxSettings);
$.isFunction(options.ajaxSetter) &&
options.ajaxSetter(q, ajaxSettings)
that.currentRequest = $.ajax(ajaxSettings).done(function (data) {
var result;
that.currentRequest = null;