mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +02:00
fix issue where empty values are always on bottom on default ascending columns
This commit is contained in:
parent
ae2e85d802
commit
85e26e949b
1 changed files with 3 additions and 6 deletions
|
@ -672,17 +672,14 @@ function loaded() {
|
|||
let valueB = entityB[currentSortColumnID];
|
||||
|
||||
if (valueA === valueB) {
|
||||
if (entityA.id < entityB.id) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
return entityA.id < entityB.id ? -1 : 1;
|
||||
}
|
||||
|
||||
if (isNullOrEmpty(valueA)) {
|
||||
return (isDefaultSort && isAscendingSort) ? 1 : -1;
|
||||
return (isDefaultSort ? 1 : -1) * (isAscendingSort ? 1 : -1);
|
||||
}
|
||||
if (isNullOrEmpty(valueB)) {
|
||||
return (isDefaultSort && isAscendingSort) ? -1 : 1;
|
||||
return (isDefaultSort ? -1 : 1) * (isAscendingSort ? 1 : -1);
|
||||
}
|
||||
return valueA < valueB ? -1 : 1;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue