Skip to content

Commit

Permalink
#2836 developing of headerMenu extension - add selecting rows/cells b…
Browse files Browse the repository at this point in the history
…ehaviour
  • Loading branch information
Alice Trofimova committed Dec 3, 2015
1 parent 996062a commit 520e4d5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/src/main/web/app/styles/vendor_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ tbody tr {
}
}

td.highlight {
background-color: #99CCFF !important;
td {
&.highlight {
background-color: #99CCFF !important;
}
&.selected {
background-color: #aab7d1;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,21 @@
/*
$(id + ' tbody').off('click');
*/
$(id + ' tbody').on('dblclick', 'td', function(e) {
var cellPos = scope.table.cell(this).index();
var rowIdx = cellPos && cellPos.row;

if (scope.selected[rowIdx]) {
scope.selected[rowIdx] = false;
$(scope.table.row(rowIdx).node()).removeClass('selected');
}

$(scope.table.cells().nodes()).removeClass('selected');
$(scope.table.cell(this).node()).addClass('selected');

e.stopPropagation();
});

$(id + ' tbody').on('click', 'tr', function(event) {
var iPos = scope.table.row(this).index();
if (scope.selected[iPos]) {
Expand Down

0 comments on commit 520e4d5

Please sign in to comment.