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: Support for expandNode() and collapseNode() API #4707

Closed
hemantg05 opened this issue Dec 22, 2020 · 3 comments · Fixed by #5058
Closed

Tree: Support for expandNode() and collapseNode() API #4707

hemantg05 opened this issue Dec 22, 2020 · 3 comments · Fixed by #5058
Assignees
Labels
type: enhancement ✨ [3] Velocity rating (Fibonacci)

Comments

@hemantg05
Copy link

hemantg05 commented Dec 22, 2020

Is your feature request related to a problem or use case? Please describe.
We would like to be able to expand or collapse a particular node on tree.

tree.expandNode(node)
tree.expandNode(nodeId)
OR
node.expand();

Same goes for collapse.
tree.collapseNode(node)
tree.collapseNode(nodeId)
OR
node.collapse();

After expand for a particular node is called, all its parent nodes should also be expanded, otherwise we won't see the node as expanded if parent node remain collapse. onSelect event should not be fired when these API are called to avoid having side effects when expandNode() and collapseNode() are called.

Describe alternatives you've considered

  1. We have considered toggleNode(). But it doesn't work. Imagine we need to expand a node 3 levels deep in a completely collpased tree. toggleNode() on 3 level deep node would not work.

  2. We also tried.
    const node = this.tree.findById(id);
    node.data = { expanded: true };
    this.tree.updateNode(node);

    Such expanded: true doesn't work in updateNode.

Additional context
We had created an enhancement request for this API in #3927. But this was missed. So creating a separate enhancement request.
Infor PIM
@karinthulin, @Carlfjord

@tmcconechy
Copy link
Member

Just checking @hemantg05 is this needed? Whats the priority for you?

@hemantg05
Copy link
Author

@tmcconechy, yes, it is still needed. We are right now living with some dirty workaround with jquery class functions, recursive functions on tree node and toggleNode() to achieve what would be provided by this API.

@tmcconechy tmcconechy added this to To do in Enterprise 4.51.x (Apr 2021) Sprint via automation Mar 4, 2021
@deep7102 deep7102 self-assigned this Apr 1, 2021
@ghost ghost moved this from To do to In progress in Enterprise 4.51.x (Apr 2021) Sprint Apr 5, 2021
@ghost ghost moved this from In progress to Pending Review in Enterprise 4.51.x (Apr 2021) Sprint Apr 9, 2021
@deep7102 deep7102 moved this from Pending Review to Ready for QA (beta) in Enterprise 4.51.x (Apr 2021) Sprint Apr 13, 2021
@CindyMercadoReyes
Copy link
Collaborator

This issue is now resolved.

@CindyMercadoReyes CindyMercadoReyes moved this from Ready for QA (beta) to Done in Enterprise 4.51.x (Apr 2021) Sprint Apr 14, 2021
@tmcconechy tmcconechy moved this from Done to NG Checked and Done in Enterprise 4.51.x (Apr 2021) Sprint Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ [3] Velocity rating (Fibonacci)
Projects
No open projects
Enterprise 4.51.x (Apr 2021) Sprint
  
NG Checked and Done
Development

Successfully merging a pull request may close this issue.

4 participants