🎨 Improve database checkbox field sorting https://github.com/siyuan-note/siyuan/issues/11016

This commit is contained in:
Daniel 2024-04-15 15:36:38 +08:00
parent c2eefd81a5
commit cd8f2049ff
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -179,6 +179,14 @@ func (table *Table) SortRows(attrView *AttributeView) {
for i, row := range table.Rows {
for _, colIndexSort := range colIndexSorts {
val := table.Rows[i].Cells[colIndexSort.Index].Value
if KeyTypeCheckbox == val.Type {
if block := row.GetBlockValue(); nil != block && block.IsEdited() {
// 如果主键编辑过,则勾选框也算作编辑过,参与排序 https://github.com/siyuan-note/siyuan/issues/11016
editedValRows[row.ID] = true
break
}
}
if val.IsEdited() {
// 如果该行某列的值已经编辑过,则该行可参与排序
editedValRows[row.ID] = true