You can achieve this by using 2 trees and re-loading the child tree on the activate
method of the parent tree.
<script type="text/javascript">
$(function() {
// Create your parent tree, set activate method to create child tree when
// parent node is selected
$("#tree").fancytree({
activate: function(event, data) {
// Use key of selected parent node to load child tree
createChildTree(data.node.key);
}
});
// Create empty child tree
$("#tree2").fancytree();
});
function createChildTree(key) {
// Remove current child tree (allows new tree to be created using key from
// selected parent)
$("#tree2").fancytree("destroy");
// Create new child tree using key from selected parent
$("#tree2").fancytree({
source: {
url: "/source/url",
data: { "key": key }
}
});
}
</script>
<div id="tree"></div>
<div id="tree2"></div>