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

223
Views
Select2.Js no muestra el menú desplegable sin ingresar valores en el archivo de texto

Usé Select2.Js para el menú desplegable. Pero el valor no se muestra en el menú desplegable sin ingresar un valor o palabra. Cada vez que tengo que insertar una palabra para obtener resultados.

Traté de hacer minimumInputLength: 0 pero no funciona. Solo necesito un menú desplegable simple.

https://i.stack.imgur.com/YNrl5.png

Aquí está mi código

 $("#stores").select2({ ajax: { url: storeSearchUrl, dataType: 'json', type: 'POST', data: function (params) { return { searchText: params.term }; }, processResults: function (data, params) { if (data.redirect) { window.location.href = data.redirect; } else { if (data.error) { app.notification('error', data.error); } else { return { results: $.map(data, function (item) { if(labaccess != null && labaccess != "" && labaccess != "[]"){ if(labaccess.includes(item.id)){ return { text: item.name, id: item.id, term: params.term } } } else{ return { text: item.name, id: item.id, term: params.term } } }) }; } } }, cache: false }, templateResult: function (item) { if (item.loading) { return item.text; } return app.markMatch(item.text, item.term); }, minimumInputLength: 0 });
about 4 years ago · Santiago Trujillo
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!