How to limit the number of results in jQuery autocomplete? -


this question has answer here:

i have searched enough, not able find solution this. please me out.

i have table has around 700 records, , want autocomplete display not more 5 records in result. should have scroll bar.

unfortunetely there no bulit in property set max limit. can use:

$("#autocmplt").autocomplete({ source: function(req, response) {     var results = $.ui.autocomplete.filter(myarray, req.term);      response(results.slice(0, 5));//for getting 5 results    } }); 

working demo


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -