简体   繁体   中英

How to set limit to jQuery mobile autocomplete to display on 10 results

I am creating an app in which I want to implement the JQM autocomplete. I had created the autocomplete it just the demo before implementing it to project.

What I want to know is how to set the limit that it will show only 10 listview results and not more than that.

Here is a link to the code of the autocomplete.

Any help is appreciated. Thanks in advance.

slice your result

var result=//your result in array




results.slice(0, 10)); // by this only 10 results come

reference slice

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM