Macbernie
Macbernie

Reputation: 1323

jstree Reveal the selected child entry

I use

$('#jstree-naf').jstree().check_node(value);

to selected the entry I need. But I need to reveal the tree until this.

Exemple (currently):

enter image description here

Should become:

enter image description here

So, the parents should be reveal.

Thanks for help

Upvotes: 1

Views: 95

Answers (2)

karim
karim

Reputation: 311

Use select_node(node/id). Selecting a node will open the tree to show it. If you don't want it do be selected you can immediately deselect it again.

Upvotes: 0

Nikolay Ermakov
Nikolay Ermakov

Reputation: 5061

Use _open_to method as below. Check demo - Demo Fiddle

$("#jstree-naf").jstree()._open_to( value );

Upvotes: 1

Related Questions