forked from travist/jquery.treeselect.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
treesearch.html
45 lines (45 loc) · 1.19 KB
/
treesearch.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
42
43
44
45
<script type='text/javascript'>
jQuery(function() {
$('div.chosensearch').chosentree({
width: 500,
deepLoad: true,
inputName: '',
input_placeholder: 'Search Groups',
input_type: 'search',
showtree: true,
load: function(node, callback) {
/**
* This would typically be replaced with an jQuery.ajax where
* you would return the tree structure for the provided node.
*/
setTimeout(function() {
callback(loadChildren(node, 0));
}, 1000);
}
});
});
</script>
<div class="chosensearch"></div>
<h2>Usage</h2>
<pre><code>
<script type='text/javascript'>
jQuery(function() {
$('div.chosensearch').chosentree({
width: 500,
deepLoad: true,
inputName: '',
input_placeholder: 'Search Groups',
input_type: 'search',
showtree: true,
load: function(node, callback) {
/**
* This would typically call jQuery.ajax to load a new node
* on your server where you would return the tree structure
* for the provided node.
*/
}
});
});
</script>
<div class="chosensearch"></div>
</code></pre>