Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
itsanmax opened this issue Sep 23, 2020 · 1 comment

Comments

@itsanmax
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant