selection management enhancements for DT/DL (#2209)

This commit is contained in:
Denys Vuika
2017-08-14 11:08:27 +01:00
committed by Eugenio Romano
parent a536bcbbd2
commit 98b4f4cef4
2 changed files with 27 additions and 8 deletions

View File

@@ -237,17 +237,17 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck
if (row) {
if (this.data) {
const newValue = !row.isSelected;
const domEventName = newValue ? 'row-select' : 'row-unselect';
if (this.isSingleSelectionMode()) {
this.resetSelection();
this.selectRow(row, newValue);
this.emitRowSelectionEvent(domEventName, row);
this.selectRow(row, true);
this.emitRowSelectionEvent('row-select', row);
}
if (this.isMultiSelectionMode()) {
const modifier = e.metaKey || e.ctrlKey;
const modifier = e && (e.metaKey || e.ctrlKey);
const newValue = modifier ? !row.isSelected : true;
const domEventName = newValue ? 'row-select' : 'row-unselect';
if (!modifier) {
this.resetSelection();
}