-
Notifications
You must be signed in to change notification settings - Fork 692
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
}
});
create
Requires jQuery UI Widget Factory 1.8.6+ Fires when the widget is created for the first time.
beforeopen
Fires right before the menu opens. Prevent the menu from opening by returning false in the handler.
open
Fires after the widget opens.
beforeclose
Fires right before the menu closes. Prevent the menu from closing by returning false in the handler.
close
Fires after the widget closes.
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).
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).
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)
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.