Skip to content
Michael edited this page Mar 12, 2018 · 20 revisions

Hook into any of the events below by either binding to the event name, or passing in the name of the event during initialization:

// bind to event
$("#multiselect").bind("multiselectopen", function(event, ui){
    // event handler here
});

// or pass in the handler during initialization
$("#multiselect").multiselect({
    open: function(event, ui){
        // event handler here
    }
});

You can cancel any of the events by returning false in the handler.


beforecheckall

Fires right before all menu options are checked.


beforeclose

Fires right before the menu closes. Prevent the menu from closing by returning false in the handler.


beforecollapseall

Fires right before all option groups are collapsed.


beforecollapsetoggle

Fires right before the collapsed state of a specific option group is toggled.


beforeexpandall

Fires right before all option groups are expanded.


beforeflipall

Fires right before all menu options are inverted (flipped).


beforeopen

Fires right before the menu opens. Prevent the menu from opening by returning false in the handler.


beforeoptgrouptoggle

Fires right before the check state of options in a specific option group is toggled.


beforeuncheckall

Fires right before all menu options are unchecked.


checkall

Fires when all the options are checked by either clicking the "check all" link in the header, or when the "checkall" method is programatically called (see next section).


click

Fires when a checkbox is checked or unchecked.

$("#multiselect").on("multiselectclick", function(event, ui) {
    //Function body
}
  • event The original event object, most likely click.
  • ui.value The value of the checkbox.
  • ui.text The text of the checkbox.
  • ui.checked Whether or not the input was checked or unchecked.

close

Fires after the widget closes.


collapseall


collapsetoggle


create

Requires jQuery UI Widget Factory 1.8.6+ Fires when the widget is created for the first time.


expandall


flipall


maxselected


open

Fires after the widget opens.


optgrouptoggle

Fires when an optgroup label is clicked on. This event receives the original event object as the first argument, and a hash of values as the second argument.

$("#multiselect").bind("multiselectoptgrouptoggle", function(event, ui){
    //Function body
});
  • event The original event object, most likely click.
  • ui.inputs An array of checkboxes (DOM elements) inside the optgroup.
  • ui.label The text of the optgroup.
  • ui.checked Whether or not the checkboxes were checked or unchecked in the toggle (bool value)

refresh


resync


uncheckall

Fires when all the options are all unchecked by either clicking the "uncheck all" link in the header, or when the "uncheckall" method is programatically called (see next section).


resize


Clone this wiki locally