how to reload/refresh/reinit DynaTree?

Mr Coder picture Mr Coder · Sep 6, 2011 · Viewed 25.3k times · Source

When I do the following

$('#tree').dynatree("option","initAjax",{url:"http://google.com"});

I want dynatree to forget about current tree data and reload with new data from the specified url instead. But I find it does not do that by default.

Thanks.

Answer

longstaff picture longstaff · Sep 6, 2011

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")