我正在使用jstree_pre1.0_fix_1。我想要预先选择菜单。jstree最初选定的菜单导致无限循环;
JavaScript是以下,
$("#Menu").jstree({
"plugins" : [ "themes", "html_data", "ui"],
"ui" :{ "initially_select" : ["#MENUITEM_012"] },
"themes" : {
"theme" : "custom",
"dots" : false,
"icons" : false,
},
}).
bind("select_node.jstree", function(e,data) {
window.location.href = data.rslt.obj.children("a").attr("href");
});
当jstree被加载时,它选择一个节点(#MENUITEM_012),然后window.location.href被改变,然后jstree加载并再次选择的节点。
我怎样才能摆脱这种情况。
这条线的要点是什么? window.location.href = data.rslt.obj.children(“a”)。attr(“href”); –
每个节点都有'a'标签。例如,'
你试过我的解决方案吗? –