mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
restore historical selection order (#3467)
* restore historical selection order * fix test
This commit is contained in:
committed by
Eugenio Romano
parent
d152c367aa
commit
1d69f5c407
@@ -601,8 +601,16 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
selectRow(row: DataRow, value: boolean) {
|
||||
if (row) {
|
||||
row.isSelected = value;
|
||||
const rows = this.data.getRows() || [];
|
||||
this.selection = rows.filter(r => r.isSelected);
|
||||
const idx = this.selection.indexOf(row);
|
||||
if (value) {
|
||||
if (idx < 0) {
|
||||
this.selection.push(row);
|
||||
}
|
||||
} else {
|
||||
if (idx > -1) {
|
||||
this.selection.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user