mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-22 04:45:12 +00:00
Update lookup sample code, closes #329
This commit is contained in:
parent
5f7f91af0b
commit
82abff9f3c
14
readme.md
14
readme.md
@ -123,13 +123,15 @@ $('#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 result = {
|
||||
suggestions: [
|
||||
{ "value": "United Arab Emirates", "data": "AE" },
|
||||
{ "value": "United Kingdom", "data": "UK" },
|
||||
{ "value": "United States", "data": "US" }
|
||||
]
|
||||
};
|
||||
|
||||
done(results);
|
||||
done(result);
|
||||
},
|
||||
onSelect: function (suggestion) {
|
||||
alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
|
||||
|
Loading…
Reference in New Issue
Block a user