@kanety/jquery-simple-select-table
v0.2.0
Published
A jquery plugin for table with selectable rows and checkboxes
Downloads
2
Maintainers
Readme
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.