How to limit the number of results in jQuery autocomplete? -
this question has answer here:
- limit results in jquery ui autocomplete 11 answers
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 } });
Comments
Post a Comment