-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree.htm
More file actions
28 lines (28 loc) · 725 Bytes
/
tree.htm
File metadata and controls
28 lines (28 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<script src="tree.js" type="text/javascript"></script>
</head>
<body>
<pre id="node"></pre>
<script type="text/javascript">
var tree = {
"table1":
[
{"id": 1, "label": "container1", "parent": null},
{"id": 2, "label": "container2", "parent": 1},
{"id": 3, "label": "container3", "parent": 1},
{"id": 4, "label": "container4", "parent": 2}
],
"table2":
[
{"id": 5, "label": "leaf1", "parent": 1},
{"id": 6, "label": "leaf2", "parent": 4},
{"id": 7, "label": "leaf3", "parent": 4},
{"id": 8, "label": "leaf4", "parent": 3}
]
}
var tree = parseTable(tree);
document.getElementById('node').innerHTML = tree;
</script>
</body>
</html>