How can you set a limit on the result from the jQuery autocomplete?
This is my code:
$.ajax({
url: \"/cache/search/SearchModels.x
The quickest way to limit results is doing it during the "open" event. We can delete part of the content dynamically created by jquery ui, reducing the children element array.
This solution solved the same issue for me:
var maxResults = 10;
$input.autocomplete({
source: somefile.json,
open: function(event,ui){
$(this).data("uiAutocomplete").menu.element.children().slice(maxResults).remove();
}
})