"Select all" option for multiple select

See original GitHub issue

I’m replacing some rather ugly jQuery UI multiselect controls with bootstrap-select and everything works quite well except I cannot find any built-in way to display a “select all” option.

The old controls look something like this:

image

I’m not proposing two options (select all and deselect all, like in the screenshot) but I would think a

[ x ] Select All

option, that floats at the top like the search bar does, would be nice to have.

I’m not a JavaScript virtuoso but if there was some interest or acceptance of this idea I could try developing it and submitting a pull request.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
gierocommented, Jun 30, 2015
$('.selectpicker').selectpicker({
    selectAllText: 'Your select-all-text',
    deselectAllText: 'Your deselect-all-text'
});
4reactions
gierocommented, Dec 29, 2014

Hi, There’s an option 'actionsBox' - set it to ‘true’ during initialization or add data-actions-box='true' for your select.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I select all options of multi-select select box on click?
Try this: $('#select_all').click(function() { $('#countries option').prop('selected', true); });. And here's a live demo.
Read more >
Javascript: Select all options for a select box - Qodo Ltd
Here's a javascript function that will allow the user to select all or none of the options in a multiple select box. It...
Read more >
Options - Multiple Select
The Options are defined in jQuery.fn.multipleSelect.defaults . name. Attribute: name. Type: String. Detail: The name of select element. Default: ''.
Read more >
React Multi Select with Check boxes and Select All option
Give your users to select/deselect all options with a single click in react-multiselect-checkboxes. We start by adding a dummy option {label: " ...
Read more >
HTML select multiple Attribute - W3Schools
For windows: Hold down the control (ctrl) button to select multiple options · For Mac: Hold down the command button to select multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found