在bootstrap-multiselect中显示全选复选框并自定义“无选定”文本

时间:2017-05-08 06:09:02

标签: jquery html checkbox multi-select bootstrap-multiselect

我正在寻找一种解决方案,用于将无选择标签更改为自己的文本。

我有这个代码, HTML:

<select id="mySelect" multiple="multiple">          
    <optgroup label="MODERN" value="MODERN">
        <option value="paintings">FAMES</option>
        <option value="works on paper">WORKS</option>
        <option value="prints">LIFE</option>
        <option value="sculptures">TIME</option>
        <option value="design">DESIRE</option>
        <option value="photography">FUTURE</option>
    </optgroup>
</select>
<select id="mySelect2" multiple="multiple">         
    <optgroup label="TREND" value="TREND">
        <option value="paintings">FAMES</option>
        <option value="works on paper">WORKS</option>
        <option value="prints">LIFE</option>
        <option value="sculptures">TIME</option>
        <option value="design">DESIRE</option>
        <option value="photography">FUTURE</option>
    </optgroup>
</select>

JS:

$(function () {
    $('#mySelect').multiselect({
        enableClickableOptGroups: true
    });
    $('#mySelect2').multiselect({
        enableClickableOptGroups: true
    });
});

Screenshot of dropdown with None Selected default text

我想将'未选中'文字改为MODERN,同时我希望select all选项包含在复选框中。

任何人都可以告诉我如何做到这一点?

0 个答案:

没有答案