1
|
<!DOCTYPE html
|
2
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
<head>
|
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
<title>jsTree v.1.0 - checkbox documentation</title>
|
8
|
<script type="text/javascript" src="../_lib/jquery.js"></script>
|
9
|
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
|
10
|
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
|
11
|
<script type="text/javascript" src="../jquery.jstree.js"></script>
|
12
|
|
13
|
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
|
14
|
<link type="text/css" rel="stylesheet" href="!style.css"/>
|
15
|
<script type="text/javascript" src="syntax/!script.js"></script>
|
16
|
</head>
|
17
|
<body>
|
18
|
<div id="container">
|
19
|
|
20
|
<h1>jsTree v.1.0 - checkbox plugin</h1>
|
21
|
<h2>Description</h2>
|
22
|
<div id="description">
|
23
|
<p>The <code>checkbox</code> plugin makes multiselection possible using three-state checkboxes.</p>
|
24
|
</div>
|
25
|
|
26
|
<h2 id="configuration">Configuration</h2>
|
27
|
<div class="panel configuration">
|
28
|
<p>No configuration possible</p>
|
29
|
</div>
|
30
|
|
31
|
<h2 id="demos">Demos</h2>
|
32
|
<div class="panel">
|
33
|
<h3>Using the checkbox plugin - all you need to do is include it in the list of active plugins.</h3>
|
34
|
<div id="demo1" class="demo">
|
35
|
<ul>
|
36
|
<li id="phtml_1">
|
37
|
<a href="#">Root node 1</a>
|
38
|
<ul>
|
39
|
<li id="phtml_2" class="jstree-checked">
|
40
|
<a href="#">Child node 1</a>
|
41
|
</li>
|
42
|
<li id="phtml_3">
|
43
|
<a href="#">Child node 2</a>
|
44
|
</li>
|
45
|
</ul>
|
46
|
</li>
|
47
|
<li id="phtml_4">
|
48
|
<a href="#">Root node 2</a>
|
49
|
</li>
|
50
|
</ul>
|
51
|
</div>
|
52
|
<script type="text/javascript" class="source">
|
53
|
$(function () {
|
54
|
$("#demo1").jstree({
|
55
|
"plugins" : [ "themes", "html_data", "checkbox" ]
|
56
|
});
|
57
|
});
|
58
|
</script>
|
59
|
|
60
|
</div>
|
61
|
|
62
|
<h2 id="api">API</h2>
|
63
|
<div class="panel api">
|
64
|
<p>The checkbox plugin maps UI's <a href="ui.html#get_selected">get_selected function</a> to its own <a href="#get_checked">get_checked function</a> and overwrites the <a href="ui.html#reselect">UI reselect function</a>. It also disables the <code>select_node</code>, <code>deselect_node</code> and <code>deselect_all</code> functions.
|
65
|
|
66
|
<h3 id="_prepare_checkboxes">._prepare_checkboxes ( node )</h3>
|
67
|
<p>Inserts the checkbox icons on the node. Used internally.</p>
|
68
|
<ul class="arguments">
|
69
|
<li>
|
70
|
<code class="tp">mixed</code> <strong>node</strong>
|
71
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
72
|
</li>
|
73
|
</ul>
|
74
|
|
75
|
<h3 id="_repair_state">._repair_state ( node )</h3>
|
76
|
<p>Repairs the checkbox state inside the node. Used internally.</p>
|
77
|
<ul class="arguments">
|
78
|
<li>
|
79
|
<code class="tp">mixed</code> <strong>node</strong>
|
80
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
81
|
</li>
|
82
|
</ul>
|
83
|
|
84
|
<h3 id="change_state">.change_state ( node , uncheck )</h3>
|
85
|
<p>Changes the state of a node. Used mostly internally - you'd be better off using the <code>check_node</code> and <code>uncheck_node</code> functions. Triggers an event.</p>
|
86
|
<ul class="arguments">
|
87
|
<li>
|
88
|
<code class="tp">mixed</code> <strong>node</strong>
|
89
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
90
|
</li>
|
91
|
<li>
|
92
|
<code class="tp">boolean</code> <strong>uncheck</strong>
|
93
|
<p>If set to <code>true</code> the node is unchecked, if set to <code>false</code> the node is checked, otherwise - the state is toggled.</p>
|
94
|
</li>
|
95
|
</ul>
|
96
|
|
97
|
<h3 id="check_node">.check_node ( node )</h3>
|
98
|
<p>Checks a node.</p>
|
99
|
<ul class="arguments">
|
100
|
<li>
|
101
|
<code class="tp">mixed</code> <strong>node</strong>
|
102
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
103
|
</li>
|
104
|
</ul>
|
105
|
|
106
|
<h3 id="uncheck_node">.uncheck_node ( node )</h3>
|
107
|
<p>Unchecks a node.</p>
|
108
|
<ul class="arguments">
|
109
|
<li>
|
110
|
<code class="tp">mixed</code> <strong>node</strong>
|
111
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
112
|
</li>
|
113
|
</ul>
|
114
|
|
115
|
<h3 id="check_all">.check_all ( )</h3>
|
116
|
<p>Checks all nodes.</p>
|
117
|
|
118
|
<h3 id="uncheck_all">.uncheck_all ( )</h3>
|
119
|
<p>Unchecks all nodes.</p>
|
120
|
|
121
|
<h3 id="is_checked">.is_checked ( node )</h3>
|
122
|
<p>Checks if a node is checked. Returns boolean.</p>
|
123
|
<ul class="arguments">
|
124
|
<li>
|
125
|
<code class="tp">mixed</code> <strong>node</strong>
|
126
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree.</p>
|
127
|
</li>
|
128
|
</ul>
|
129
|
|
130
|
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="get_unchecked"> </span></div>
|
131
|
<h3 id="get_checked">.get_checked ( context ), .get_unchecked ( context )</h3>
|
132
|
<p>Both functions return jQuery collections.</p>
|
133
|
<ul class="arguments">
|
134
|
<li>
|
135
|
<code class="tp">mixed</code> <strong>context</strong>
|
136
|
<p>This can be a DOM node, jQuery node or selector pointing to an element within the tree. If specified only nodes inside the specified context are returned, otherwise the whole tree is searched.</p>
|
137
|
</li>
|
138
|
</ul>
|
139
|
|
140
|
<div style="height:1px; visibility:hidden; overflow:hidden;"><span id="hide_checkboxes"> </span></div>
|
141
|
<h3 id="show_checkboxes">.show_checkboxes ( ), .get_unchecked ( )</h3>
|
142
|
<p>Show or hide the checkbox icons.</p>
|
143
|
|
144
|
</div>
|
145
|
|
146
|
</div>
|
147
|
</body>
|
148
|
</html>
|