@kanety/jquery-simple-select-table

0.2.0 • Public • Published

jquery-simple-select-table

A jquery plugin for table with selectable rows and checkboxes.

Dependencies

  • jquery

Installation

Install from npm:

$ npm install @kanety/jquery-simple-select-table --save

Usage

Build html as follows:

<table>
  <tr>
    <th><input type="checkbox"></th>
    <th>header</th>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>1</td>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>2</td>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>3</td>
  </tr>
</table>

Then run:

$('table').simpleSelectTable();

Options

Selector options:

$('table').simpleSelectTable({
  headCheckbox: 'th :checkbox',
  dataCheckbox: 'td :checkbox',
  rowSelector: 'td'
});

Feature options:

$('table').simpleSelectTable({
  useShiftClick: true,
  useCtrlClick: true,
  useUpDownKey: true
});

Callbacks

$('table').simpleSelectTable({
  ...
}).on('row:selected', function(e, $row) {
  ...
}).on('row:unselected', function(e, $row) {
  ...
});

License

The library is available as open source under the terms of the MIT License.

Package Sidebar

Install

npm i @kanety/jquery-simple-select-table

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

27.2 kB

Total Files

15

Last publish

Collaborators

  • kanety