I would like to know how I can make the Child 1
and the Child 2
checkbox to be what I can check and uncheck?
Note: But only these two we .
Code JSFiddle
I would like to know how I can make the Child 1
and the Child 2
checkbox to be what I can check and uncheck?
Note: But only these two we .
Code JSFiddle
You can enable the option to use checkbox
in the plugin and hide with CSS those that are not descendants of .jstree-children
, eg:
HTML
<div id="jstree">
<ul>
<li>Folder 1
<ul>
<li id="child_1">Child 1</li>
<li>Child 2</li>
</ul>
</li>
<li>Folder 2</li>
</ul>
</div>
CSS
ul:not(.jstree-children) > li.jstree-node > a.jstree-anchor > i.jstree-checkbox
{
display:none;
}
jQuery
$(function () {
$('#jstree').jstree({
"checkbox": {
"keep_selected_style": true
},
"plugins": ["checkbox"]
});
});