Skip to content

Commit 5c30e47

Browse files
committed
FIX #2 documentation of attrs parameter in renderTree
1 parent a4bdca9 commit 5c30e47

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ paramter | description | required | default
121121
tree | the tree data | X |
122122
childrenAttr | the attribute used to navigate the hierarchical tree structure| | 'children'
123123
idAttr | the attribute used to identify a node | | 'id'
124-
attrs | a map of attribute names and labels to be rendered | all attributes except the childrenAttr, label = name |
124+
attrs | a map of attribute names and labels to be rendered | all attributes except the childrenAttr e.g. {id: 'Name' , yob : 'Born in'} |
125125
renderer | a rendreing function for custom rendering | |
126126
tableAttributes | additional table attributes (ie id or class). Can be useful for styling. The css class *jsTT* will always be added. | |
127127

doc/renderTree.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,45 @@
2727

2828
var data = [{
2929
id : 'Harold',
30-
geb : 1933,
30+
yob : 1933,
3131
parent : 'Robert'
3232
}, {
3333
id : 'Robert',
34-
geb : 1903,
34+
yob : 1903,
3535
parent : 'John'
3636
}, {
3737
id : 'Thomas',
38-
geb : 2008,
38+
yob : 2008,
3939
parent : 'Mathew'
4040
}, {
4141
id : 'Mathew',
42-
geb : 1977,
42+
yob : 1977,
4343
parent : 'Harold'
4444
}, {
4545
id : 'Andrew',
46-
geb : 1974,
46+
yob : 1974,
4747
parent : 'Harold'
4848
}, {
4949
id : 'Kate',
50-
geb : 2008,
50+
yob : 2008,
5151
parent : 'Mathew'
5252
}, {
5353
id : 'Walter',
54-
geb : 1900,
54+
yob : 1900,
5555
parent : 'John'
5656
}, {
5757
id : 'Michelle',
58-
geb : 2023,
58+
yob : 2023,
5959
parent : 'Thomas'
6060
}
6161
, {
6262
id : 'James',
63-
geb : 1900,
63+
yob : 1900,
6464
parent : 'Kate'
6565
}]
6666

6767
var tree = makeTree(data)
68-
var rendered = renderTree(tree)
68+
var rendered = renderTree(tree, 'children', 'id', {id: 'Name' , yob : 'Born in'})
6969

7070
$('body').append(rendered)
7171
</script>

0 commit comments

Comments
 (0)