Demo
I want to select multiple rows using Windows Shift and Ctrl keys, like multiple folder selection in Windows.
From table of selected ro
Here's a jQuery plugin I wrote recently for a project. Thought sharing...
Works exactly like you're used to, + it's extremely fast cause it operates over an Array without the need to check for attributes, classes etc, and the add/removeClass triggers only on the selected elements:
// Use like:
// $("table").selekt();
//
// Available options:
$("table").selekt({
children: "tr", // Elements to target (default: "tbody tr")
className: "selected", // Desired CSS class (default: "selected")
onSelect: function(sel) { // Useful callback
$("span").text(sel.length + ' in ' + this.id);
}
});
.selected { background: #0bf; }
table {border: 1px solid #555;display: inline-block; vertical-align: top;}
Seleceted: 0
1 SELECT ME
2 SELECT ME
3 SELECT ME
4 SELECT ME
5 SELECT ME
6 SELECT ME
1 SELECT ME
2 SELECT ME
3 SELECT ME
4 SELECT ME