🎨 属性视图增减行列 https://github.com/siyuan-note/siyuan/issues/7521 https://github.com/siyuan-note/siyuan/issues/7522
This commit is contained in:
parent
96cd0fd3d1
commit
f0d4d7ed4b
1 changed files with 17 additions and 0 deletions
|
@ -93,6 +93,23 @@ func AddAttributeViewColumn(name string, typ string, columnIndex int, avID strin
|
|||
return
|
||||
}
|
||||
|
||||
func RemoveAttributeViewColumn(columnID string, avID string) (err error) {
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
for i, column := range attrView.Columns[1:] {
|
||||
if column.ID == columnID {
|
||||
attrView.Columns = append(attrView.Columns[:i], attrView.Columns[i+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
err = av.SaveAttributeView(attrView)
|
||||
return
|
||||
}
|
||||
|
||||
func removeAttributeViewBlock(blockID, avID string, tree *parse.Tree, tx *Transaction) (err error) {
|
||||
node := treenode.GetNodeInTree(tree, blockID)
|
||||
if nil == node {
|
||||
|
|
Loading…
Add table
Reference in a new issue