mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
#82 sort order fix for datatable
use ‘asc’ as default order when clicking on another sortable column header
This commit is contained in:
parent
ceed1a0a48
commit
30558fb571
@ -90,7 +90,10 @@ export class DataTableComponent implements OnInit, AfterViewChecked {
|
||||
onColumnHeaderClick(column: DataColumn) {
|
||||
if (column && column.sortable) {
|
||||
let current = this.data.getSorting();
|
||||
let newDirection = current.direction === 'asc' ? 'desc' : 'asc';
|
||||
let newDirection = 'asc';
|
||||
if (column.key === current.key) {
|
||||
newDirection = current.direction === 'asc' ? 'desc' : 'asc';
|
||||
}
|
||||
this.data.setSorting(new DataSorting(column.key, newDirection));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user