mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 15:24:03 +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];
|
let valueB = entityB[currentSortColumnID];
|
||||||
|
|
||||||
if (valueA === valueB) {
|
if (valueA === valueB) {
|
||||||
if (entityA.id < entityB.id) {
|
return entityA.id < entityB.id ? -1 : 1;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNullOrEmpty(valueA)) {
|
if (isNullOrEmpty(valueA)) {
|
||||||
return (isDefaultSort && isAscendingSort) ? 1 : -1;
|
return (isDefaultSort ? 1 : -1) * (isAscendingSort ? 1 : -1);
|
||||||
}
|
}
|
||||||
if (isNullOrEmpty(valueB)) {
|
if (isNullOrEmpty(valueB)) {
|
||||||
return (isDefaultSort && isAscendingSort) ? -1 : 1;
|
return (isDefaultSort ? -1 : 1) * (isAscendingSort ? 1 : -1);
|
||||||
}
|
}
|
||||||
return valueA < valueB ? -1 : 1;
|
return valueA < valueB ? -1 : 1;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue