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

Only one top node? #8

Open
icodeforyou opened this issue Sep 30, 2015 · 9 comments
Open

Only one top node? #8

icodeforyou opened this issue Sep 30, 2015 · 9 comments

Comments

@icodeforyou
Copy link

Is the component limited to one top node or is this in some way configurable ?

@wangzuo
Copy link
Contributor

wangzuo commented Oct 1, 2015

Yes, a root node is required for the json tree.

@wangzuo wangzuo closed this as completed Oct 6, 2015
@edgesoft
Copy link

@wangzuo Is it possible to allow not to render the root node itself?

@edgesoft
Copy link

@icodeforyou @wangzuo I've implemented code to enable the root node to not be rendered. shouldRenderRootNode can be passed as prop to tree and default is true. Want a pull request for this?

This will enable the view to have the look of many rootnodes but there is still only one.

@wangzuo
Copy link
Contributor

wangzuo commented Oct 21, 2015

@edgesoft Cool, would like to take a look at it.

But will it also be possible to make it through css only?

@wangzuo wangzuo reopened this Oct 21, 2015
@edgesoft
Copy link

@wangzuo But if we set visiblity to none on the rootnode we will prevent the entire tree to render. Do you have any suggestion on how to make this possible with css?

@edgesoft
Copy link

@wangzuo Maybe

color: transparent;
background: transparent;

@dannav
Copy link

dannav commented Oct 21, 2015

I just select the first node and hide it.

.m-tree > .m-node > .inner {
display: none;
}

@edgesoft
Copy link

@dannav @wangzuo This works great. Only need to reset the padding. Should I delete the pull request?

@wangzuo
Copy link
Contributor

wangzuo commented Oct 22, 2015

No, i will check the pr later.

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

4 participants