nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jqTree / _entries / 52_opennode.md
1 ---
2 title: openNode
3 name: functions-opennode
4 ---
5
6 **function openNode(node);**
7
8 **function openNode(node, slide);**
9
10 **function openNode(node, on_finished);**
11
12 **function openNode(node, slide, on_finished);**
13
14 Open this node. The node must have child nodes.
15
16 Parameter **slide (optional)**: open the node using a slide animation (default is true).
17 Parameter **on_finished (optional)**: callback when the node is opened; this also works for nodes that are loaded lazily
18
19 {% highlight js %}
20 // create tree
21 var $tree = $('#tree1');
22 $tree.tree({
23     data: data
24 });
25
26 var node = $tree.tree('getNodeById', 123);
27 $tree.tree('openNode', node);
28 {% endhighlight %}
29
30 To open the node without the slide animation, call with **slide** parameter is false.
31
32 {% highlight js %}
33 $tree.tree('openNode', node, false);
34 {% endhighlight %}
35
36 Example with `on_finished` callback:
37
38 {% highlight js %}
39 function handleOpened(node) {
40     console.log('openende node', node.name);
41 }
42
43 $tree.tree('openNode', node, handleOpened);
44 {% endhighlight %}