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

Feature Request #17

Open
DonGar opened this issue Apr 3, 2017 · 3 comments
Open

Feature Request #17

DonGar opened this issue Apr 3, 2017 · 3 comments

Comments

@DonGar
Copy link

DonGar commented Apr 3, 2017

This is an amazing tool, thank you for building it!

I'd like to be able to update the json structure dynamically and preserve which nodes are open or folded.

Perhaps by having a way to query for the currently 'open' nodes, and to pass that result in when generating the replacement HTML. The query result would have to be somewhat aware of the data content so that nodes not present after the update are ignored. This same mechanism could be used to give people fine grained control over which nodes are opened during the initial display.

@razor-1
Copy link

razor-1 commented Aug 7, 2017

+1, would be wonderful to programmatically control what's expanded and what isn't

@adjenks
Copy link

adjenks commented Oct 30, 2018

Yes, I was really looking for a ElementWrapper.expandAll() function.

@adjenks
Copy link

adjenks commented Oct 30, 2018

Here's a wacky method to open the next layer of all of the trees on the page:

document.querySelectorAll('span:not([class]').forEach(function (el) {
	var a = (((el.children[0] || {}).children|| [])[0] || {});
	(a.click || function(){} ).bind(a)();
})

In english:
Get the first child of the first child of the span elements without class attributes, and click them all.

Be careful though, If this matches some similar structure on your page, you might click something you don't want to click.

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