Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm using Select2 script to fill Dropdowns(Asp.net C#). Select2 is slow when opening its dropdown menu if the underlying select has a fair number of item. I have more than 15000 records in my dropdown. Is there any solution to reduce this slow?

I'm filling dropdown code behind. This is my script
<script type="text/javascript">
           $(".js-example-placeholder-single").select2({
               placeholder: "Select a state",
               allowClear: true
           });

       </script>
Posted
Updated 25-Jan-16 17:37pm
v3
Comments
Mehdi Gholam 26-Jan-16 5:10am    
15000 is a lot try making it smaller!

1 solution

15,000 is way too many. If you look at the source you'll see why it is your browser is so slow. That's a lot for your browser to handle.

I suggest allowing them to filter.

Also, can you imagine how hard it would be for a user to find the 1 single option they want out of 15,000 choices? The scroll bar must be absolutely tiny and very hard to find what they need.
 
Share this answer
 
Comments
amnk.info 26-Jan-16 8:51am    
Thanks for reply.This is our client requirement.That's why we are in struggle. minimum we can add 1 filter for this. :(
ZurdoDev 26-Jan-16 9:02am    
You should be honest with your client and tell them that a 15,000 drop down is unusable. Then suggest filtering.
amnk.info 26-Jan-16 9:20am    
Thanks for reply. i will try

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900