0

I am using Select2 plugin to enable search in the select tag. I have a large number of options (5000+), and it makes a small delay when the select tag is clicked.

Is there any way to limit the number of items loaded, but should show when the user search.

Note : I use ajax and php to append options.

Any help would be appreciated.

Munawir
  • 3,196
  • 8
  • 31
  • 47
  • hav you tried anything on your end? – Bhushan Kawadkar Dec 19 '18 at 07:10
  • @BhushanKawadkar I had searched over internet for past 2 days and can't understand, from where do I start. I can limit the number of items loaded, but then the search functionality will work only on the loaded options. – Munawir Dec 19 '18 at 07:13
  • 1
    Check this https://stackoverflow.com/questions/15041058/select2-performance-for-large-set-of-items if useful for you – Bhushan Kawadkar Dec 19 '18 at 07:18
  • 1
    and this one as well - https://stackoverflow.com/questions/32533757/select2-v4-how-to-paginate-results-using-ajax – Angel Deykov Dec 19 '18 at 07:19
  • I am using select2 with ajax as well, and can easily work with millions of options. A proper ajay request will only query for about ten items. When you scroll or search, the old items are destroyed. – olidem Aug 24 '19 at 19:54

0 Answers0