【发布时间】:2012-06-13 15:26:35
【问题描述】:
我正在使用以下代码:
$("#treeview").jstree();
$("#treeview").jstree('open_all');
使用以下html:
<div id="treeview">
<ul>
<li>
<a href="#">rubentebogt</a>
<ul>
<li>
<a href="#" onclick="goTo('index.php?module=alarm&pagina=dashboard&id=6',false);">Beneden</a>
</li>
<li>
<a href="#" onclick="goTo('index.php?module=alarm&pagina=dashboard&id=7',false);">Boven</a>
</li>
</ul>
</li>
</ul>
</div>
我的问题是所有节点都保持关闭状态,我无法使用jstree('open_all'); 打开它们。
【问题讨论】:
-
你能发布你生成的 HTML 而不是 Smarty 吗?
-
@Mr.sinoser 发表评论
Note: when you use jQuery .on() method you should check your add jQuery core!! because this method is ready on jQuery 1.7 and upper and While the .bind() method existing in jQuery 1.0(从答案复制,答案标记为删除) -
在我的例子中,它只是与
$("#treeview").jstree('open_all');中的语句一起工作,如link 中所示
标签: javascript jquery jstree