davidstutz / bootstrap-multiselect

JQuery multiselect plugin based on Twitter Bootstrap.
https://davidstutz.github.io/bootstrap-multiselect/
Other
3.66k stars 1.99k forks source link

onSelectAll event handler parameter is undefined #1268

Open TheNephalim opened 1 year ago

TheNephalim commented 1 year ago

According to the documentation, when defining the event handler for onSelectAll there should be an options parameter available.

The following is taken from my code:

const hullSelectElement = document.getElementById("mail-setting-hulls");

let options = {
    includeSelectAllOption: true,
    selectAllValue: 'multiselect-all',
    numberDisplayed: 0,
    maxHeight: 200,
    buttonClass: 'cfr-custom-select btn btn-outline-dark btn-block ',
    buttonContainer : '<div class="dropdown" />',
    enableCaseInsensitiveFiltering: true,
    includeFilterClearBtn: true
};

options.onSelectAll = function(selectedOptions) {
    console.log(arguments);
    toastr.info("On Select All hulls");
};

$(hullSelectElement).multiselect(options);

When I define the event handler and execute my code, the event handler triggers, but the options parameter is 'undefined.' I added console.log(arguments) to the event handler and it indicates the arguments length is 0.

Any assistance is appreciated.