Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fancytree getSelectedNodes without using the select event

I am using the fancytree plugin to render a directory and next to this fancytree is a button. The user is supposed to click this button, and I am supposed to get a list of selected nodes from the tree and do something with it.

How do I access the list of selected nodes from the tree in my button.click event?

$('#button').click(function() {
   // how to get selected nodes in tree
});
like image 802
dr.jekyllandme Avatar asked Apr 18 '15 22:04

dr.jekyllandme


1 Answers

The accepted answer gave me a "No such method" error. This worked:

$('#tree').fancytree('getTree').getSelectedNodes();
like image 148
miles82 Avatar answered Nov 08 '22 00:11

miles82