Reputation: 1334
I am using Dyna Tree plugin for tree view.
Now, while expanding the parent node I am using lazy load function,
onLazyRead: function(node){
node.appendAjax({
url: TREEVIEW_JSON_URL
});
}
Now I would like to expand all the child and sub-child nodes those are available in my response with lazyLoad. In the current scenario I am able to expand only child nodes.
Please help me out on this. Thanks in advance
Upvotes: 1
Views: 5133
Reputation: 14794
You could try something like this (haven't tested it though):
$("#tree").dynatree({
[…]
onLazyRead: function(node){
node.appendAjax({url: TREEVIEW_JSON_URL,
success: function(node) {
// Called after nodes have been created and the waiting icon was removed.
// now expand all children
node.visit(function(n){
n.expand(true);
});
}
});
},
[…]
});
Upvotes: 7