Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!