-
Notifications
You must be signed in to change notification settings - Fork 686
Events
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
}
});
beforecheckall
Fires right before all menu options are checked. Cancel the event by returning false in the handler.
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. Cancel the event by returning false in the handler.
beforecollapsetoggle
Fires right before the collapsed state of a specific option group is toggled. Cancel the event by returning false in the handler.
beforeexpandall
Fires right before all option groups are expanded. Cancel the event by returning false in the handler.
beforeflipall
Fires right before all menu options are inverted (flipped). Cancel the event by returning false in the handler.
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. Cancel the event by returning false in the ***
beforeuncheckall
Fires right before all menu options are unchecked. Cancel the event by returning false in the handler.
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
filter
input
search