admin管理员组文章数量:1241084
How to create a root node using 'create' method
Root
|___ Child1
|___ Child2
I am using JsTree, by using 'json_data' I can able to create nodes, but I want to create all nodes dynamically using 'create' method.
Please help me....
How to create a root node using 'create' method
Root
|___ Child1
|___ Child2
I am using JsTree, by using 'json_data' I can able to create nodes, but I want to create all nodes dynamically using 'create' method.
Please help me....
Share Improve this question asked Aug 1, 2012 at 9:14 sokidsokid 8134 gold badges10 silver badges17 bronze badges2 Answers
Reset to default 11As of version 3.0.0-beta10 of jsTree, to create a top-level node, the reference for the parent is "#"
. For example:
$("#jstree").jstree('create_node', '#', {'id' : 'myId', 'text' : 'My Text'}, 'last');
The older answer given here didn't work with that version of jsTree.
Maybe it is what you are looking for:
$("#tree").jstree("create", -1, false, "Name", false, true);
本文标签: javascriptJsTree how to create a root nodeStack Overflow
版权声明:本文标题:javascript - JsTree how to create a root node - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740049135a2222059.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论