使用jsTree,我试图根据ID自动检查某些节点。我正在使用HTML_DATA和Checkbox插件。
$("#ItemTree").jstree({
"plugins" : [ "themes", "html_data", "checkbox", "sort", "ui" ],
});
我的UL
<div id="ItemTree">
<ul>
<li>
<a id="37" href="#37">This item should auto check.</a>
</li>
<ul>
</div>
如何自动检查id =“37”?
答案 0 :(得分:3)
<div id="ItemTree">
<ul>
<li class="jstree-checked">
<a id="37" href="#37">This item should auto check.</a>
</li>
<ul>
</div>
答案 1 :(得分:0)
您需要按如下方式添加课程jstree-clicked
:
<div id="ItemTree">
<ul>
<li>
<a id="37" href="#37" class="jstree-clicked">This item should auto check.</a>
</li>
<ul>
</div>