[Checkboxes] Multi-Select with Shift and Ctrl/Cmd Keys | Shift-Select

shiftMultiSelect.js, a jQuery plugin that allows you to convert by clicking multiple checkboxes in table rows to easily select multiple rows at once.

It gives a Check All performance that allows the user to select/deselect all rows in your HTML table with a single click.

Must Read – A Multi Select Picker for Bootstrap 4 | Mutiselect-bs4

How to make use of it:

1. Load the primary script shiftMultiSelect.js after jQuery.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/shiftMultiSelect.js"></script>

2. Add a bunch of checkboxes to table rows as follows.

<table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row"><input type="checkbox" id="id_chk1" class="checkRow" value="1" /></th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope="row"><input type="checkbox" id="id_chk2" class="checkRow" value="2" /></th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row"><input type="checkbox" id="id_chk3" class="checkRow" value="3" /></th>
      <td>Larry</td>
      <td>the Bird</td>
      <td>@<a href="#!">twitter</a></td>
    </tr>
  </tbody>
</table>

3. Create a ‘Master’ checkbox input to check/uncheck all table rows.

<thead>
  <tr>
    <th scope="col"><input type="checkbox" name='checkboxMaster' /></th>
    <th scope="col">First</th>
    <th scope="col">Last</th>
    <th scope="col">Handle</th>
  </tr>
</thead>

4. Get the checked values.

$(':checkbox').change(function() { 
  console.log(checkValArray) 
});
=> ["1", "2", "3", "4", "5"]

5. Use CSS to focus on table rows that are checked.

.table-primary, .table-primary>th, .table-primary>td { 
  background-color: #7F8C8D; 
  color: #fff; 
}

Read More – 

[Live Search] Minimal and Dynamic Multiple Select Replacement
Multiple Easy Select Combo Box with Checkboxes | MSFmultiSelect


See Demo And Download

Official Website(ryandougc): Click Here

This superior jQuery/javascript plugin is developed by ryandougc. For extra Advanced Usage, please go to the official website.

Share