infinite-tree icon indicating copy to clipboard operation
infinite-tree copied to clipboard

tree.openNode function is not working for a node while updating tree data via tree.loadData function

Open itsanmax opened this issue 4 years ago • 1 comments

I've a scenario where L2(Child) level tree structure is opened. Clicking on L2 context menu icon, which do something and switching context menu icon to some other icon. To do this, managing a flag variable at each node to show the corresponding icon at particular node level and after updating this flag data with each node, need to re-render the tree so that as per corresponding flag variable, context icon appear at DOM.

Getting below issues after updating tree data:

  • On Re-render Tree data, L2 or other child level nodes is closed and only L1 level nodes appear
  • To open the child nodes after loading Tree data, using Tree function as tree.openNode(parentNode); but seems it doesn't work.

My full code is as per below:

// load updated tree data
that.tree.loadData(that.props.treeconfig.listOfContanier);
// getting parent node L1 level
let parentNode = that.props.selectedNode;
const { tree } = that.treeRef.current;
// Below code should open referred node and child nodes should appear as it has child data. But seems not working so
tree.openNode(parentNode);

Does anyone run into the such kind of issues? Any help would be appreciated.

itsanmax avatar Sep 23 '20 06:09 itsanmax

Seems no one is looking into this. Kindly help if anyone faced this issue and having any work around solutions.

itsanmax avatar Sep 28 '20 05:09 itsanmax