The current version of jQtree (0.1.3) allows you to lazily load from the server.
In the documentation you must provide the url:
<div id="tree1" data-url="/nodes/"></div >
$('#tree1').tree({ dataUrl: '/example_data.json' data: <original data> });
All subsequent requests will add an id node like this:
<data-url>?node=<node-id>
And you should set load_on_demand:
[ { label: 'Saurischia', id: 1, load_on_demand: true }, { label: 'Ornithischians', id: 23, load_on_demand: true } ]
See also:
http://mbraak.github.com/jqTree/examples/example5.html
But I was not able to get this to work, and I had to manually attribute the dataUrl attribute with something like:
$(document).ready(function() { $("#tree1").tree({ dataUrl: function(node) { if (node) { return '/nodes.json?node=' + node.id; } else { return '/nodes.json' } } }).bind('tree.click', function(event) { var node = event.node; }); });
source share