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

89
Vistas
Selectize.js take a long time to create structure

I have a problem with Selectize.js, where it is taking a long time to create the structure, I make a request in my backend where it returns about 1000 data, which does not take 500ms of response, but when adding the options in my Selectize.js using addOption and addItem takes more than 10 seconds. Is there a way to improve this or a faster alternative?

Javascript:

$('#my-select').selectize({
    sortField: 'text'
});

//initialize request
var request = $.ajax({
    url: "/request_data.php",
    type: "post",
    dataType: 'json',
});

// Callback handler that will be called on success
request.done(function (response, textStatus, jqXHR) {
    response.forEach(function (data) {
        ///////////////////////////////////HERE TAKE A LONG TIME
        form_field_select[0].selectize.addOption({ value: data.id, text: data.text });
        form_field_select[0].selectize.addItem(data.id);
    });
});

HTML

<select id="my-select">
    <option value="">Select any option</option>
</select>
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