how to reload/refresh/reinit DynaTree?

2019-01-22 21:31发布

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.

7条回答
不美不萌又怎样
2楼-- · 2019-01-22 22:03

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 (see http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html).

查看更多
登录 后发表回答