how to reload/refresh/reinit DynaTree?
Function the initialization:
function InitTree() {
$("#tree3").dynatree({
(...init params...)
});
}
InitTree();
To reload data, call:
$("#tree3").dynatree("destroy");
InitTree();
look at the tree.reload()
method, it should do what you are after.
see the docs here: http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html#h8.2
as in the docs, the tree is the internal drawing of the tree, and you get it by calling the getTree command: $("#node").dynatree("getTree")
tree.reload();
is for data loaded dynamically as in Ajax. If you are working with ul/li lists and need to reload your tree, you have to do:
$("#tree").dynatree("destroy");
before your regular dynatree creation code. The destroy
parameter is not documented.