Newer
Older
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Fancytree - Example: ThemeRoller</title>
<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">
<link href="../src/skin-themeroller/ui.fancytree.css" rel="stylesheet">
<script src="../src/jquery.fancytree.js"></script>
<script src="../src/jquery.fancytree.columnview.js"></script>
<script src="../src/jquery.fancytree.table.js"></script>
<script src="../src/jquery.fancytree.themeroller.js"></script>
<!-- Start_Exclude: This block is not part of the sample code -->
<link href="../lib/prettify.css" rel="stylesheet">
<script src="../lib/prettify.js"></script>
<link href="sample.css" rel="stylesheet">
<script src="sample.js"></script>
<script src="../lib/Super-Theme-Switcher/jquery.themeswitcher.js"></script>
<style type="text/css">
ul.fancytree-container,
table.fancytree-container{
font-size: 0.8em;
}
</style>
<script type="text/javascript">
$(function(){
$("#switcher").themeswitcher({
jqueryuiversion: "1.12.1",
imgpath: "../lib/Super-Theme-Switcher/images/",
loadTheme: "base",
additionalthemes: [{
title: "Base",
name: "base",
icon: "theme_90_base.png"
}]
});
});
</script>
<!-- End_Exclude -->
<style type="text/css">
/* Fancytree extension 'table' */
table.fancytree-ext-table {
width: 100%;
}
/* Fancytree extension 'columnview' */
table.fancytree-ext-columnview {
border-collapse: collapse;
width: 100%;
}
table.fancytree-ext-columnview tbody tr[0] {
height: 200px;
}
</style>
<!-- Add code to initialize the tree when the document is loaded: -->
<script type="text/javascript">
$(function(){
// Attach the fancytree widget to an existing <div id="tree"> element
// and pass the tree options as an argument to the fancytree() function:
$("#tree").fancytree({
extensions: ["themeroller"],
checkbox: true,
themeroller: {
addClass: "" // no rounded corners
// selectedClass: "ui-state-active"
},
source: [
{title: "Node 1"},
{title: "Node 2",
children: [{title: "Subnode 2.1"}, {title: "Subnode 2.2"}]
},
{title: "Node 3",
children: [{title: "Subnode 3.1"}, {title: "Subnode 3.2"}]
},
{title: "Node 4"}
]
});
$("#treetable").fancytree({
extensions: ["table", "themeroller"],
checkbox: true,
themeroller: {
// addClass: "",
// selectedClass: "ui-state-active"
},
source: {
url: "ajax-tree-plain.json"
},
activate: function(event, data) {
},
lazyLoad: function(event, data) {
data.result = {url: "ajax-sub2.json"}
},
renderColumns: function(event, data) {
var node = data.node,
$tdList = $(node.tr).find(">td");
$tdList.eq(1).text(node.key);
$tdList.eq(2).text(!!node.folder);
}
});
$("#columnview").fancytree({
extensions: ["columnview", "themeroller"],
checkbox: true,
source: {
url: "ajax-tree-plain.json"
},
activate: function(event, data) {
},
lazyLoad: function(event, data) {
data.result = {url: "ajax-sub2.json"}
}
});
});
</script>
</head>
<body class="example">
<h1>Example: 'themeroller' extension</h1>
<div class="description">
<p>
Allow to apply <a href="http://jqueryui.com/themeroller/" target="_blank">jQuery ThemeRoller</a>
styles.
</p>
<p>
<b>Status</b>: beta
</p>
</div>
<div>
<label for="switcher">Theme:</label> <div id="switcher"></div>
<!--
<label for="skinswitcher">Skin:</label> <select id="skinswitcher"></select>
-->
</div>
<!-- Add a <table> element where the tree should appear: -->
<p class="description">
Standard tree:
</p>
<div id="tree"></div>
<!-- Add a <table> element where the tree should appear: -->
<p class="description">
Table tree:
</p>
<table id="treetable">
<colgroup>
<col width="*"></col>
<col width="200px"></col>
<col width="100px"></col>
</colgroup>
<thead>
<tr> <th></th> <th>Key</th> <th>Folder</th> </tr>
</thead>
<tbody>
<tr> <td></td> <td></td> <td></td> </tr>
</tbody>
</table>
<!-- Add a <table> element where the tree should appear: -->
<p class="description">
Columnview tree:
</p>
<table id="columnview">
<colgroup>
<col width="300px"></col>
<col width="300px"></col>
<col width="300px"></col>
</colgroup>
<thead>
<tr> <th>1</th> <th>2</th> <th>3</th> </tr>
</thead>
<tbody>
<tr> <td>?</td> <td>?</td> <td>?</td> </tr>
</tbody>
</table>
<!-- Start_Exclude: This block is not part of the sample code -->
<hr>
<p class="sample-links no_code">
<a class="hideInsideFS" href="https://github.com/mar10/fancytree">jquery.fancytree.js project home</a>
<a class="hideOutsideFS" href="#">Link to this page</a>
<a class="hideInsideFS" href="index.html">Example Browser</a>
<a href="#" id="codeExample">View source code</a>
</p>
<pre id="sourceCode" class="prettyprint" style="display:none"></pre>
<!-- End_Exclude -->
</body>
</html>