Estoy tratando de usar BsMultiSelect .
¿Cómo puedo habilitar/deshabilitar manualmente un menú de selección?
Pude deshabilitar con éxito el menú así
// 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();Luego traté de habilitarlo así, lo que no funcionó.
// 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();Un poco tarde, pero tuve un problema idéntico y lo resolví con la opción integrada getDisabled de bsMultiSelect, que requiere verdadero o falso.
Luego usé $('#yourMultiSelectOption').attr('custom-data-attr', false/true).bsMultiSelect("UpdateDisabled") para cambiar primero el atributo a la opción deseada y luego desencadenar manualmente una actualización de bsMultiSelect .
$(#yourMultiSelectOption).bsMultiSelect({ getDisabled: function () { return $("#yourMultiSelectOption").attr('custom-data-attr') === 'true'; }, [other options...] })