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.
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:
My full code is as per below:
Does anyone run into the such kind of issues? Any help would be appreciated.