我正在使用David bootstrap multiselect http://davidstutz.github.io/bootstrap-multiselect/,当检查复选框时,我找不到禁用标签修改的方法。例如。我的代码:
<select multiple="multiple" name="more[]" id="more">
<option value="Centres d'intérêt">Centres d'intérêt</option>
<option value="Concession">Concession</option>
<option value="Délai d'achat">Délai d'achat</option>
<option value="Usage">Usage</option>
<option value="Financement">Financement</option>
</select>
和JS:
$('#more').multiselect({
includeSelectAllOption: false,
preventInputChangeEvent: true,
enableFiltering: true,
numberDisplayed: 1000,
maxHeight: 300,
nonSelectedText: "<span class='label-m'>{{ tran('admin/contacts/table.more') }}</span>",
allSelectedText: "<span class='label-m'>{{ tran('admin/contacts/table.more') }}</span>",
enableCaseInsensitiveFiltering: true,
templates:{
button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown" data-placement="bottom"></button>'
},
onChange: function(option, checked, select) {
}
});
上一页how it looks和how it should look even when checkbox is checked
编辑: jsfiddle演示:http://jsfiddle.net/y7c9zus1/3/
感谢您的所有答案!
答案 0 :(得分:1)
您可以使用buttonText
选项:
buttonText: function (options, select) {
//you also can count the selected options here to do whatever you want
return 'My fixed label';
}