mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4313] - Sort order doesn't work correctly (#8892)
[ACA-4313] - Sort order doesn't work correctly
This commit is contained in:
@@ -742,7 +742,7 @@ export class DataTableComponent implements OnInit, AfterContentInit, OnChanges,
|
||||
isColumnSorted(col: DataColumn, direction: string): boolean {
|
||||
if (col && direction) {
|
||||
const sorting = this.data.getSorting();
|
||||
return sorting && sorting.key === col.key && sorting.direction.toLocaleLowerCase() === direction;
|
||||
return this.isSortingEqual(col, direction, sorting);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1018,6 +1018,12 @@ export class DataTableComponent implements OnInit, AfterContentInit, OnChanges,
|
||||
|
||||
this.columnsWidthChanged.emit(allColumns);
|
||||
}
|
||||
|
||||
private isSortingEqual(col: DataColumn, direction: string, sorting: DataSorting): boolean {
|
||||
return sorting &&
|
||||
(sorting.key === col.key || sorting.key === col.sortingKey) &&
|
||||
sorting.direction?.toLocaleLowerCase() === direction;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DataTableDropEvent {
|
||||
|
Reference in New Issue
Block a user