Fancytree jQuery plugin - select node

I am having a hard time selecting a given node from fancytree plugin.

So, I tried something like:

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

      

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

Can anyone please help?

+3


source to share


1 answer


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

      



+10


source







All Articles