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

expand the tree only one level #13

Open
swana1337 opened this issue Sep 20, 2021 · 2 comments
Open

expand the tree only one level #13

swana1337 opened this issue Sep 20, 2021 · 2 comments

Comments

@swana1337
Copy link

is there a possible way that i can expand just one level of the tree ? so my tree has like 5 levels and i only want to open one level at a time? is there a possible way to do so ?

my tree looks like this:

root
sublevel1
sublevel2

if i click on the root node i just want sublevel 1 to appear, but everytime all nodes appear.

thanks! :)

@con0aks
Copy link

con0aks commented Feb 11, 2022

After init of tree i added:

$('.treejs-switcher').each(function() { if (!$($(this)[0].parentNode).hasClass('treejs-node__close')) { $($(this)[0].parentNode).addClass('treejs-node__close') } });

Not very elegant but does the trick...

@jirapetr
Copy link

jirapetr commented Aug 3, 2022

After init of tree i added:

$('.treejs-switcher').each(function() { if (!$($(this)[0].parentNode).hasClass('treejs-node__close')) { $($(this)[0].parentNode).addClass('treejs-node__close') } });

Not very elegant but does the trick...

Thank you!

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

3 participants