Implementation of selecting all in the drop-down box of bootstrap-table display column

ask for help: how to select all in the drop-down box of the fields that can be displayed in the bootstrap-table list?

clipboard.png

clipboard.png


fill in the hole for yourself.
solution:
1, add "Select all" to the column parameter configuration

columns: [
        {
            title: '',
            field: '',
            visible: false,
        },
        
    ]

2.bootstrap-table rendering

$("-sharptb_transitList").bootstrapTable(newOption);

3. Add click event

var checkOne = $(".dropdown-menu li input");
var checkAll = checkOne.eq(0);
checkAll.off('click').on('click', function () {
    var flag = checkAll.prop("checked");
    checkOne.each(function(i){
        if (i>0){
            var $this = $(this);
            if (flag) {
                if (!$this.prop('checked')) {
                    $this.click();
                }
            } else {
                if ($this.prop('checked')) {
                    $this.click();
                }
            }
        }
    });
});
checkOne.on('click', function () {
    var len = checkOne.length;
    var _l = 0;
    checkOne.each(function(i){
        if (i>0){
            if ($(this).prop('checked')) {
                _lPP;
            }
        }
    });
    if (_l === len-1){
        checkAll.prop("checked", true)
    } else {
        checkAll.prop("checked", false)
    }
});
Menu