G6: 使用combo,node从combo1拖动到combo2,删除节点node,展开和关闭bombo后报错,combo内节点全消失

Created on 11 Dec 2020  ·  3Comments  ·  Source: antvis/G6

哪里使用的方法不对,有知道的吗
ERROR TypeError: Cannot read property 'group' of null
at e.t.get (g6.min.js:30)
at e.t.changeVisibility (g6.min.js:30)
at t.changeItemVisibility (g6.min.js:30)
at e.hideItem (g6.min.js:30)
at g6.min.js:30
at Array.forEach ()
at t.collapseCombo (g6.min.js:30)
at e.collapseCombo (g6.min.js:30)
at e.collapseExpandCombo (g6.min.js:30)
at i.onComboClick (g6.min.js:30)

Most helpful comment

解决办法,在删除之前先将节点从combo中移除
this.graph.updateComboTree(n.getModel().id);

All 3 comments

解决办法,在删除之前先将节点从combo中移除
this.graph.updateComboTree(n.getModel().id);

解决办法,在删除之前先将节点从combo中移除
this.graph.updateComboTree(n.getModel().id);

正解,removeItem 里面缺少了这个逻辑,下个小版本我们会加上的。

ok

Was this page helpful?
0 / 5 - 0 ratings