Boostrap multiselect select all checked by default

后端 未结 2 873
情话喂你
情话喂你 2021-02-03 11:52

i use bootstrap-multiselect (v0.9.8) with option

 includeSelectAllOption: true 

it is posible that select all to be checked by default when pag

2条回答
  •  孤街浪徒
    2021-02-03 12:14

    The following is taken from http://davidstutz.github.io/bootstrap-multiselect/, and I am currently using this solution with bootstrap 3.3.1 and bootstrap-multiselect v0.9.8 Be sure to add the false parameter to the 'selectAll' function as that permits you to select all the options without first opening the dropdown.

    Example HTML:

    
    

    Example javascript:

    $(function() {
    
        $('#my-multi-select').multiselect({
            includeSelectAllOption: true
        });
    
        $("#my-multi-select").multiselect('selectAll', false);
        $("#my-multi-select").multiselect('updateButtonText');
    
    });
    

提交回复
热议问题