-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb00d8f
commit f632464
Showing
7 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi man, can you explain me how add some custom data in each node?
Image or else. I add the object named "extra"
this is correct?. Sorry for my bad English.
[
{
"id": 2,
"name": "name1",
"role": "mother",
"class": "woman",
"depthOffset": 1,
"marriages": [
{
"spouse": {
"id": 1,
"name": "name2",
"class": "man"
},
"children": [
{
"id": 3,
"name": "name3",
"role": "hus",
"class": "man",
"depthOffset": 1,
"marriages": [
{
"spouse": {
"id": 4,
"name": "name4",
"class": "woman"
},
"children": [
{
"id": 5,
"name": "kid1",
"role": "sister",
"class": "woman",
"secondname": ""
},
{
"id": 6,
"name": "kid2",
"role": "sister",
"class": "woman",
"secondname": ""
}
]
}
],
"extra": [
{
"secondname": "sec1",
"image": ""
}
]
}
]
}
],
"extra": [
{
"secondname": "sec2",
"image": ""
}
]
}
]
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
The extra field is another field for each node/person.
See how it's used in the official example: https://treehouse.gartner.io/ErikGartner/58e58be650453b6d49d7
Jasper has an extra attribute containing his favorite color.
Best regards,
Erik
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. You made awesome plugin.
But if in tree can i have ex-wife and wife in same marriage?
And ex-wife has own childrens and another husband.
Or some kind of path line from ex-husband to ex-wife.
You plan this in future?
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! You can have multiple marriage by passing multiple in spouses to the marriage attribute..
No support for new husband etc. It's a good feature request but I'm currently very busy so I won't implement it any time soon. Feel free to make a pull request adding it.
/Erik
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Erik, one more question. I don't really understand how a extra fields works, I add some info in extra fields but no effects. I must use functions in callback? In your demo
you add extra field but not show a dtree init code.
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you need to pass in custom rendering functions for either just the text or the entire node.
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Erik, this is me again).
here i try add some extra information in node but get a error.
Like this = extra.secondname - got error undefined "secondname".
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at this example.
https://jsfiddle.net/tpde0cer/212/
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Erik again. Can i have a parents for spouse nodes?
f632464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No unfortunately not, see #32.