mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-25 22:27:39 +00:00
Update lookup sample code, closes #329
This commit is contained in:
parent
5f7f91af0b
commit
82abff9f3c
@ -123,13 +123,15 @@ $('#autocomplete').autocomplete({
|
|||||||
lookup: function (query, done) {
|
lookup: function (query, done) {
|
||||||
// Do ajax call or lookup locally, when done,
|
// Do ajax call or lookup locally, when done,
|
||||||
// call the callback and pass your results:
|
// call the callback and pass your results:
|
||||||
var results = [
|
var result = {
|
||||||
|
suggestions: [
|
||||||
{ "value": "United Arab Emirates", "data": "AE" },
|
{ "value": "United Arab Emirates", "data": "AE" },
|
||||||
{ "value": "United Kingdom", "data": "UK" },
|
{ "value": "United Kingdom", "data": "UK" },
|
||||||
{ "value": "United States", "data": "US" }
|
{ "value": "United States", "data": "US" }
|
||||||
];
|
]
|
||||||
|
};
|
||||||
|
|
||||||
done(results);
|
done(result);
|
||||||
},
|
},
|
||||||
onSelect: function (suggestion) {
|
onSelect: function (suggestion) {
|
||||||
alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
|
alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
|
||||||
|
Loading…
Reference in New Issue
Block a user