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

Get nodes, when click one node with request (json)? #15

Closed
ankkk opened this issue Feb 20, 2018 · 1 comment
Closed

Get nodes, when click one node with request (json)? #15

ankkk opened this issue Feb 20, 2018 · 1 comment

Comments

@ankkk
Copy link

ankkk commented Feb 20, 2018

@David-Desmaisons thank you for vue d3 tree. I would like to know how I can open the list, first, after receiving it from the server (json)? That is, when you click on 1 node.

Example JSON:

One node:

[{
  "id": 1,
  "first_name": "Freddie",
  "last_name": "Readhead",
  "count_friends": 9
}, {
  "id": 2,
  "first_name": "Cyndi",
  "last_name": "Sampson",
  "count_friends": 12
}, {
  "id": 3,
  "first_name": "Jan",
  "last_name": "Ferney",
  "count_friends": 19
}, {
  "id": 4,
  "first_name": "Dita",
  "last_name": "Grut",
  "count_friends": 15
}, {
  "id": 5,
  "first_name": "Mar",
  "last_name": "Abry",
  "count_friends": 21
}]

Next node:

[{
  "id": 1,
  "first_name": "Flo",
  "last_name": "Janu",
  "count_friends": 3
}, {
  "id": 2,
  "first_name": "Ardelia",
  "last_name": "Heijne",
  "count_friends": 5
}, {
  "id": 3,
  "first_name": "Wrennie",
  "last_name": "Luipold",
  "count_friends": 2
}]

And other...

How can i do this?

@David-Desmaisons
Copy link
Owner

Use the prop data to bind the tree data. It is recative so it can be null initially and react when you set to the actual data.

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