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

139
Vistas
How to enable/disable BsMultiSelect

I am trying to use BsMultiSelect.

How can I manually enable/disable a select menu?

I was able to successfully disable the menu like so

// remove all options
removeOptions(select); 

// disable the select element
select.setAttribute('disabled', true); 

// update the data since all options were removed
select.updateData();

// update the appearance of the menu since it is now disabled
select.updateAppearance();

Then I tried to enable it like this which did not work

// add new options to the select element
addOptions(select);

// enable the select element
select.removeAttribute('disabled');


// update the data since new options were added
select.updateData();

// update the appearance of the menu since it is now enabled
select.updateAppearance();
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

A bit late, but I had an identical problem and solved it by the build-in option getDisabled from bsMultiSelect, which requires either true or false.

I then used $('#yourMultiSelectOption').attr('custom-data-attr', false/true).bsMultiSelect("UpdateDisabled") to first change the attribute to the desired option and then manually trigger an update of the bsMultiSelect.

$(#yourMultiSelectOption).bsMultiSelect({
    getDisabled: function () {
                     return $("#yourMultiSelectOption").attr('custom-data-attr') === 'true';
                 },
    [other options...]
})

about 4 years ago · Juan Pablo Isaza Denunciar
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