checkbox
旁边有selectpicker
。我希望如果复选框被选中,selectpicker将被启用,如果未选中,selectpicker将被禁用。 我写这里面是不工作(Here is the fiddle):如何通过ickeck复选框启用/禁用bootstrap selectpicker
$('.checkBox').on('ifChecked', function(event) {
$(this).parents('.clearfix').find('.selectpicker').removeAttr('disabled');
});
$('.checkBox').on('ifUnchecked', function(event) {
$(this).parents('.clearfix').find('.selectpicker').attr('disabled');
});
非常感谢! – user1896653 2014-12-05 14:08:08
还有一个简单的启用/禁用示例[在文档中](http://silviomoreto.github.io/bootstrap-select/methods/#selectpickerrefresh)。 – Leith 2017-04-04 02:19:06