Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

122
Vistas
Select2 with Angular works slow with more than 1500 data size

I am using select2 with Angular. I've got a lot of results (about 5k) opening select box is quite slow.

This is my component

    ngAfterViewInit(): void {
    
        $('#carrierSelector').select2({
    
          matcher: (params, data) => {
    
            const { value } = data.element;
            let filter:string = String(params.term).toLowerCase();;
            const { Name, CarrierId, CarrierName } = this.carriers.find((item:ICarrier) => item.index === parseInt(value));
    
            // If there are no search terms, return all of the data
            if ($.trim(params.term) === '') {
              return data;
            }
    
            if (Name.toLowerCase().indexOf(filter) > -1 ||
                CarrierId.toLowerCase().indexOf(filter) > -1 ||
                CarrierName.toLowerCase().indexOf(filter) > -1) {
    
                let modifiedData = $.extend({}, data, true);
                return modifiedData;
    
            }
    
            // Return `null` if the term should not be displayed
            return null;
    
          }
    
        });
    }

I tried a lot of ways like ajax, but it doesn't work for me

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda