Load / append data on click of node #10

aaronlcope opened this Issue Apr 9, 2012 · 4 comments

3 participants


I don't see a way to append new data to an existing node when you click it. Is there a way to issue an ajax request for more data under a particular node and have this plugin append more nodes via JSON formatted responses?

If this already exists, is there any sample code anywhere?


At this moment it's not possible to add nodes dynamically to the tree. I think it would be a nice feature, though.

It is possible to load a whole new tree using the function loadData (http://mbraak.github.com/jqTree/#functions-loadData).


The 'dev' branch contains a new feature for loading a subtree. The function 'loadData' now accepts a 'parent_node' parameter.

$tree.tree('loadData', data, parent_node);

Example for loading subtree on click:

    function(e) {
        var node = e.node;

            function(data) {
                $tree.tree('loadData', data, node);

Implemented in version 0.7

@mbraak mbraak closed this Apr 23, 2012

There is still an issue here. 'tree.click' event won't be always triggered. For example, if you try to move a node to inside a closed node, it will open the node but won't trigger the 'tree.click' event.

I'll create a separate issue since this was already closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment