How to select a specific node programmatically?

Just wanted to chime in here as none of the answers worked for me. What finally DID work was very simple: $(‘#someTree’).jstree(‘select_node’, ‘someNodeId’); Note that I didn’t initialize someNodeId as a jQuery object. It’s just a plain string. I did this right after a tree was loaded without putting it into a “ready” bind event … Read more

How do I open all nodes in jquery Jstree?

The jsTree documentation is “sub optimal”. The docs don’t clearly state that the initialization works asynchronously. There’s core.loaded(): A dummy function, whose purpose is only to trigger the loaded event. This event is triggered once after the tree’s root nodes are loaded, but before any nodes set in initially_open are opened. This suggests an event … Read more

Configuring jstree right-click contextmenu for different node types

The contextmenu plugin already has support for this. From the documentation you linked to: items: Expects an object or a function, which should return an object. If a function is used it fired in the tree’s context and receives one argument – the node that was right clicked. So rather than give contextmenu a hard-coded … Read more