mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3131] fix selection order for DT/DL (#3433)
* fix selection order for DT/DL * remove fit
This commit is contained in:
committed by
Eugenio Romano
parent
465a2d090d
commit
35d2a0b683
@@ -422,7 +422,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
if (rows && rows.length > 0) {
|
||||
rows.forEach(r => r.isSelected = false);
|
||||
}
|
||||
this.selection.splice(0);
|
||||
this.selection = [];
|
||||
}
|
||||
this.isSelectAllChecked = false;
|
||||
}
|
||||
@@ -613,17 +613,8 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
selectRow(row: DataRow, value: boolean) {
|
||||
if (row) {
|
||||
row.isSelected = value;
|
||||
const idx = this.selection.indexOf(row);
|
||||
|
||||
if (value) {
|
||||
if (idx < 0) {
|
||||
this.selection.push(row);
|
||||
}
|
||||
} else {
|
||||
if (idx > -1) {
|
||||
this.selection.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
const rows = this.data.getRows() || [];
|
||||
this.selection = rows.filter(r => r.isSelected);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user