1

I have a page with two fancytrees on the page - Tree1 and Tree2.

Under Tree1 is a button "show activities"

When this button is clicked then Tree2 will load it's content based on the node selection in Tree1.

How can I do this?

I'm thinking a click handler for the button that gets the id of tree1 and the active node, calls an AJAX to get the content then updates Tree2 with the new content.

Is this sensible? How do I reference each tree from the button handler?

Thkanks

  • OK once I figured out how to get the tree object. tree = $("#tree").fancytree("getTree"); ... then I could do this for tree 1 and 2 then access the selection and content in each tree. Simply writing the control code between them. Easy in the end ! – Living Bliss Sep 19 '16 at 01:34

1 Answers1

0

OK once I figured out how to get the tree object:

var tree = $("#tree").fancytree("getTree"); 

So I got the object for tree 1 and 2 then can access the selection and content in each tree. Simple then to write the control code between them. Easy in the end !