-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
41 lines (33 loc) · 1.25 KB
/
index.html
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
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>JTree</title>
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="js/jquery.treeJson.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.treeJson.css" />
<style>
body {
font-family: Arial;
font-size: 12px;
}
</style>
<script type="text/javascript" >
$(document).ready(function() {
var fnSubmit = function(sndValue) {
alert("Submitted: " + sndValue);
};
var jsonSrc = "json.txt";
$('#treeroot').treeJson({
"jsonSrc" : jsonSrc, // json src, must be in the correct format
"displayText" : "name", // value that will be displayed
"sndValue" : "key", // value that will be sent
"collapse" : true, // show the first node or not
"after" : fnSubmit // function is triggered when pressing on 1 node
});
});
</script>
</head>
<body>
<div id="treeroot"></div>
</body>
</html>