【发布时间】:2011-07-06 22:30:58
【问题描述】:
我正在尝试重新加载 jstree 而不重新加载或刷新页面,重新加载应该发生在按钮的 onclick 上,所以当单击按钮时我正在调用
$("#tree-container").jstree('destroy');
//then calling the function that reads or renders the tree
当没有树已经渲染时工作正常,但是当树已经渲染并且我点击按钮时,我得到这个:“无法调用未定义的方法初始化。”错误发生在jstree plugin。
我什至尝试删除容器,然后在调用读取树的函数之前将其重新附加到它的父容器
$("#tree-container").remove();
$('#parent-tree-container').append($('<div id="tree-container"></div>'));
//then called the function that reads/renders the tree
但这仍然不起作用。 :(
提前致谢。
【问题讨论】:
标签: jstree