How to load multiple records within a Combo?

0

I need to create a feature for a system that the person can select multiple records in a Combo, but the problem is that I'm loading more than 5000 records and the browser is crashing.

Is there any way to create this without crashing? Type an autocomplete with the possibility of selecting multiple records?

Information is coming from a JSON.

Example of what I'm using:

    
asked by anonymous 12.03.2015 / 17:58

2 answers

1

You can try something like this

$('#selectID').bind('scroll', function(){
    if($(this).scrollTop() + $(this).innerHeight()>=$(this)[0].scrollHeight){
        // sua chamada ajax. e dando sucesso, voce adiciona um ".html(data)" no ultimo item do seu select
        // ou utiliza o json aqui e faz a logica
    }
});
    
12.03.2015 / 21:38
1

What is the need for a list of 5,000 options?!

Is there no way to split the weight of this load?

JSON is often quick and easy to handle, so the best alternative is to really split this view.

    
12.03.2015 / 21:25