Skip to content

Commit 062e9bd

Browse files
author
Tomas Kirda
committed
Add support for custom lookup function.
1 parent d71867a commit 062e9bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/jquery.autocomplete.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,15 @@
537537
return;
538538
}
539539

540+
if ($.isFunction(that.lookup)){
541+
that.lookup(q, function (data) {
542+
that.suggestions = data.suggestions;
543+
that.suggest();
544+
options.onSearchComplete.call(that.element, q, data.suggestions);
545+
});
546+
return;
547+
}
548+
540549
if (that.isLocal) {
541550
response = that.getSuggestionsLocal(q);
542551
} else {

0 commit comments

Comments
 (0)