Fancytree jQuery plugin - select node

9k Views Asked by At

I have difficulties in selecting a given node from fancytree plugin.

So, I have tried something like:

$("#tree").fancytree("getTree").visit(function(node){
    node.select(n);
});

where "n" is any number representing the node id, but it doesn'work, even if the select() function exists in documentation

Could someone help?

1

There are 1 best solutions below

2
On
var tree = $("#tree").fancytree("getTree");
var node = tree.getNodeByKey(n);
node.setSelected(true);