//////////////////////////////////////////
// Row Selection
//////////////////////////////////////////
jq('#work_orders tbody').on("click","tr", function(event) {
if(!lastChecked) {
lastChecked = this;
}
if(event.shiftKey) {
var start = jq('#work_orders tbody tr').index(this);
var end = jq('#work_orders tbody tr').index(lastChecked);
for(i=Math.min(start,end);i<=Math.max(start,end);i++) {
if (!jq('#work_orders tbody tr').eq(i).hasClass('row_selected')){
jq('#work_orders tbody tr').eq(i).addClass("row_selected");
}
}
// Clear browser text selection mask
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
} else if (document.selection) { // IE?
document.selection.empty();
}
} else if ((event.metaKey || event.ctrlKey)){
jq(this).toggleClass('row_selected');
} else {
jq(this).toggleClass('row_selected');
}
lastChecked = this;
});
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.