My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 227 attachment: dynatree.html (1.4 KB)

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
<!DOCTYPE html>
<html>
<head>
<title>Minimal example for Dynatree Bug #227</title>
<meta charset="UTF-8">
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.min.js"></script>
<script src="jquery.dynatree.js"></script>
</head>
<body>
<div id="tree"></div>
<script>
var treeData = [ // Pass an array of nodes.
{title: "Item 1"},
{title: "Folder 2", isFolder: true,
children: [
{title: "Sub-item 2.1"},
{title: "Sub-item 2.2"}
]
},
{title: "Item 3"}
];

$('#tree').dynatree({
debugLevel: 0,

// work-around for bug https://code.google.com/p/dynatree/issues/detail?id=227 -- do not handle clicks on folders automatically but e.g. in onClick function
//clickFolderMode: 0,

onClick: function(node, event) {
console.log('click on ' + node);
},
onDblClick: function(node, event) {
console.log('double click on ' + node);
},
children: treeData
});
</script>
</body>
</html>
Powered by Google Project Hosting