2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-29 00:06:36 +00:00

Fixing custom lookup data object

This commit is contained in:
David Ollerhead 2015-03-16 16:15:37 +00:00
parent 5f7f91af0b
commit 962fe292c3

View File

@ -123,11 +123,13 @@ $('#autocomplete').autocomplete({
lookup: function (query, done) {
// Do ajax call or lookup locally, when done,
// call the callback and pass your results:
var results = [
{ "value": "United Arab Emirates", "data": "AE" },
{ "value": "United Kingdom", "data": "UK" },
{ "value": "United States", "data": "US" }
];
var results = {
"suggestions" : [
{ "value": "United Arab Emirates", "data": "AE" },
{ "value": "United Kingdom", "data": "UK" },
{ "value": "United States", "data": "US" }
]
};
done(results);
},