Skip to content

Instantly share code, notes, and snippets.

@lou
Created April 22, 2012 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lou/2466265 to your computer and use it in GitHub Desktop.
Save lou/2466265 to your computer and use it in GitHub Desktop.
multiselect public methods
// You must init the multiple select with $('#your-select').multiSelect() before calling one of the following methods
$('#your-select').multiSelect('select', 'value'); // Select the item with the value given in parameter
$('#your-select').multiSelect('deselect', 'value'); // Deselect the item with the value given in parameter
$('#your-select').multiSelect('select_all', true); // Select all elements. If parameter visible set to true, it will select only visible items. Otherwise it will also select hidden items
$('#your-select').multiSelect('deselect_all'); // Deselect all items previously selected
$('#your-select').multiSelect('refresh'); // Refresh current multiselect. It will re-init the multiselect based on the <select> element (useful for when select is update through Ajax)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment