2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-22 12:55:12 +00:00

Add support for custom lookup function.

This commit is contained in:
Tomas Kirda 2014-10-06 15:48:34 -05:00
parent d71867a090
commit 062e9bdacf

View File

@ -537,6 +537,15 @@
return; return;
} }
if ($.isFunction(that.lookup)){
that.lookup(q, function (data) {
that.suggestions = data.suggestions;
that.suggest();
options.onSearchComplete.call(that.element, q, data.suggestions);
});
return;
}
if (that.isLocal) { if (that.isLocal) {
response = that.getSuggestionsLocal(q); response = that.getSuggestionsLocal(q);
} else { } else {