bootstrap-multiselect icon indicating copy to clipboard operation
bootstrap-multiselect copied to clipboard

Simulate single selections using checkboxes : documentation isn't updated

Open eved42 opened this issue 6 years ago • 0 comments

Hi, just a note about the documentation example Simulate single selections using checkboxes. The code in the example doesn't correspond to the real code.

Please, can you update your documentation ?

This doesn't work :

$('#example-simulate-single').multiselect({
    on: {
        change: function(option, checked) {
            var values = [];
            $('#example-simulate-single option').each(function() {
                if ($(this).val() !== option.val()) {
                    values.push($(this).val());
                }
            });
 
            $('#example-simulate-single').multiselect('deselect', values);
        }
    }
});

Do this :

$('#example-simulate-single').multiselect({
    onChange: function(option, checked) {
        var values = [];
        $('#example-simulate-single option').each(function() {
            if ($(this).val() !== option.val()) {
                values.push($(this).val());
            }
        });

        $('#example-simulate-single').multiselect('deselect', values);
    }
});

eved42 avatar Oct 24 '19 08:10 eved42