Do something after getting result jQuery UI Autocomplete
Am I blind or is there not possibility to do something after gettings results in jQuery UI Autocompelete?
This what I'm trying: user starts writing address in input field, Autocomplete gets suggestions and all those suggestions what the Autocomplete shows, should be showed on a map. The showing on map part I can do but how can I trigger it when the Autocomplete gets results? I saw there was "Select"-event and such but no "search-suggestions-are-read开发者_Python百科y"-event. How should I do it then? Any suggestions.
The js now:
$("form#search .address").autocomplete({
source: function( request, response ) {
$.ajax({
url: addresses.php,
dataType: "json",
data: {term: request.term},
success: function(data) {
response($.map(data, function(item) {
return {
label: item.addy
};
}));
}
});
},
minLength: 2
});
All help appcreciated. Thank you!
Try the open
event, it occurs when the suggestion window is opened (meaning the results were already given).
精彩评论