Bootstrap 多选
Bootstrap multiselect
我正在使用 David bootstrap 多选 http://davidstutz.github.io/bootstrap-multiselect/,当复选框为 checked.Eg 时,我找不到禁用标签修改的方法。我的代码:
<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 and how it should look even when checkbox is checked
编辑:
jsfiddle 演示:http://jsfiddle.net/y7c9zus1/3/
谢谢大家的回答!
您可以使用 buttonText
选项:
buttonText: function (options, select) {
//you also can count the selected options here to do whatever you want
return 'My fixed label';
}
我正在使用 David bootstrap 多选 http://davidstutz.github.io/bootstrap-multiselect/,当复选框为 checked.Eg 时,我找不到禁用标签修改的方法。我的代码:
<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 and how it should look even when checkbox is checked
编辑: jsfiddle 演示:http://jsfiddle.net/y7c9zus1/3/
谢谢大家的回答!
您可以使用 buttonText
选项:
buttonText: function (options, select) {
//you also can count the selected options here to do whatever you want
return 'My fixed label';
}