Skip to content
Michael edited this page Jan 11, 2017 · 32 revisions

Interact with the multiselect instance after it has been initialized by calling any of the below methods.

// example:
$("#multiselect").multiselect("method_name");

open

Opens the menu.


close

Closes the menu.


refresh

Reloads the checkbox menu. If you're dynamically adding/removing option tags on the original select via AJAX or DOM manipulation methods, call refresh to reflect the changes in the widget.


disable

Disable the entire widget.


enable

Enable the entire widget.


checkAll

Check all checkboxes.


uncheckAll

Uncheck all checkboxes.

In single select mode, this will also clear the current selection.


isOpen

Returns a boolean denoting if the widget is currently open or not.


getChecked

Returns an array of all the checked boxes.


getUnchecked

Returns an array of all the boxes that are not checked.


getButton

Returns the button element.


widget

Returns the menu container (all checkboxes inside).


option

Set or get one of the options after the widget has been initialized. If changing an option, the new option setting will take affect immediately.


destroy

Destroy the widget and return to the original select box.


getMenu

Returns the menu element for the widget.


getLabels

Returns the labels for the options within the widget, the inputs are children of these labels.


addOption

Allows you to add an option to the widget and the source element without the need for a refresh.

Parameters:

attributes: Attributes object for the option element being added. Should at least contain a value.

text: Text to display for the option

groupLabel: If supplied, the option will be added under the option group with this textual label.


removeOption

Removes an option from the menu and source element that has the given value.

Parameters:

value: The value attribute of the element to be removed.

Clone this wiki locally