This commit is contained in:
Daniel 2024-04-15 13:27:19 +08:00
parent 483ae3b671
commit a049eeec3e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 21 additions and 11 deletions

View file

@ -213,13 +213,17 @@ func (table *Table) SortRows(attrView *AttributeView) {
sorted := true
for _, colIndexSort := range colIndexSorts {
val1 := editedRows[i].Cells[colIndexSort.Index].Value
if nil == val1 {
return colIndexSort.Order == SortOrderAsc
}
val2 := editedRows[j].Cells[colIndexSort.Index].Value
if nil == val2 {
return colIndexSort.Order != SortOrderAsc
if nil == val1 || val1.IsEmpty() {
if nil != val2 && !val2.IsEmpty() {
return false
}
sorted = false
continue
} else {
if nil == val2 || val2.IsEmpty() {
return true
}
}
result := val1.Compare(val2, attrView)