nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jqTree / _entries / 45_getstate.md
1 ---
2 title: getState
3 name: functions-getstate
4 ---
5
6 Get the state of tree: which nodes are open and which one is selected?
7
8 Returns a javascript object that contains the ids of open nodes and selected nodes:
9
10 {% highlight js %}
11 {
12     open_nodes: [1, 2, 3],
13     selected_node: [4, 5, 6]
14 }
15 {% endhighlight %}
16
17 If you want to use this function, then your tree data should include an **id** property for each node.
18
19 You can use this function in combination with [setState](#functions-setstate) to save and restore the tree state.