Skip to content

How to set a default path of nodes to be expanded? #441

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

Closed
sockthedev opened this issue Feb 8, 2023 · 2 comments
Closed

How to set a default path of nodes to be expanded? #441

sockthedev opened this issue Feb 8, 2023 · 2 comments

Comments

@sockthedev
Copy link

Howdy, thanks for this fantastic library. I'm building a fun little project and this will become a core mechanism of interaction for the users. I'd be happy to share when I launch it.

I have one question, sorry I tried parsing the docs but the answer wasn't explicitly obvious.

I would like to load the tree with a specific path expanded (everything else collapsed).

For example, given the following tree;

             A
           /   \
          /     \
         B       E
        / \
       /   \
      C     D

I would like to be able to set the path of A -> B -> D to be be visible/expanded when the tree initially loads;

             A
           /   
          /     
         B 
          \
           \
            D

Is this possible? I'm happy to utilise an imperative API is there is one suitably available.

Thanks again x

@sockthedev
Copy link
Author

Duplicate of #402 😅

@danielbeeke
Copy link

Something like this patch can work:
https://gist.github.com/danielbeeke/ca8e4c6a95928d11cc9b8df0f7c18628

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

2 participants