mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-20 22:14:06 +01:00
🎨 Improve database field sorting Fix https://github.com/siyuan-note/siyuan/issues/11038
This commit is contained in:
parent
483ae3b671
commit
a049eeec3e
2 changed files with 21 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue