【发布时间】:2021-10-01 15:31:16
【问题描述】:
我正在尝试使用BsMultiSelect。
如何手动启用/禁用选择菜单?
我能够像这样成功禁用菜单
// 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();
然后我尝试像这样启用它,但没有成功
// 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();
【问题讨论】: