【发布时间】:2014-02-19 00:06:55
【问题描述】:
我使用 Jstree 1.0RC3 并没有让它工作来选择一个节点并让树打开以便该节点可见。 我的代码是这样的:
.jstree({
// List of active plugins
"plugins" : [
"themes","json_data","ui","crrm","dnd","search","types","hotkeys","contextmenu"
//"themes","json_data","ui","crrm","cookies","dnd","types","hotkeys"
],
"json_data" : {
"ajax" : {
"url" : $path + "/server.php",
"data" : function (n) {
return {
"operation" : "get_children",
"id" : n.attr ? n.attr("id").replace("node_","") : <?php echo($jstree_root); ?>
};
}
}
},
},
"core" : {
// just open those two nodes up
// as this is an AJAX enabled tree, both will be downloaded from the server
"initially_open" : [ <?php echo($jstree_root_node); ?> ]
UI 插件为空。 php echo($jstree_root_node) 打开根目录下的第一个层次结构以获得更好的概览。有时我想传递应该选择的节点的 ID。默认情况下,通过打开树,此节点并不总是可见。我看到的是,如果节点在第一个层次结构中可见,它将被选中。如果更深,则不被选中。
我在论坛中发现在 JSTREE 调用之前使用它,但它不起作用:
.bind("reopen.jstree", function () {
$("#demo").jstree("select_node", "#node_1637");
$("#node_1637").parents(".jstree-closed").each(function () {
$("#demo").jstree("open_node", this, false, true);
});
})
关于这个有什么想法吗?它似乎就在我的鼻子前面,但我没有看到它......
gb5256
【问题讨论】:
标签: jstree