The way you do this will be to combine the results received from the server with a local array of results. You can do this by passing the function options source autocomplete
You need to complete three steps:
- Make an AJAX request and get the results from the server.
- Filter local array
- Combine Results
It should be pretty simple. Something like this will work:
$("input").autocomplete({ source: function(request, response) { var localResults = $.ui.autocomplete.filter(localArray, request.term); $.ajax({ success: function(data) { response(data.concat(localResults)); } }); } }); , if necessary, then concatenate local $("input").autocomplete({ source: function(request, response) { var localResults = $.ui.autocomplete.filter(localArray, request.term); $.ajax({ success: function(data) { response(data.concat(localResults)); } }); } });
I have reviewed here is a complete example: http://jsfiddle.net/FZ4N4/
source share