mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Adding row overwriting data after enabling filter in database https://github.com/siyuan-note/siyuan/issues/9395
This commit is contained in:
parent
210a3ac547
commit
65adab61c9
3 changed files with 25 additions and 17 deletions
|
|
@ -508,6 +508,16 @@ type TableRow struct {
|
|||
Cells []*TableCell `json:"cells"`
|
||||
}
|
||||
|
||||
func (row *TableRow) GetBlockValue() (ret *Value) {
|
||||
for _, cell := range row.Cells {
|
||||
if KeyTypeBlock == cell.ValueType {
|
||||
ret = cell.Value
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (table *Table) GetType() LayoutType {
|
||||
return LayoutTypeTable
|
||||
}
|
||||
|
|
@ -569,6 +579,12 @@ func (table *Table) FilterRows() {
|
|||
|
||||
rows := []*TableRow{}
|
||||
for _, row := range table.Rows {
|
||||
block := row.GetBlockValue()
|
||||
if !block.IsInitialized && nil != block.Block && "" == block.Block.Content && block.IsDetached {
|
||||
rows = append(rows, row)
|
||||
continue
|
||||
}
|
||||
|
||||
pass := true
|
||||
for j, index := range colIndexes {
|
||||
operator := table.Filters[j].Operator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue