2
I would like to know how I do so that the us Child 1
and the Child 2
be of the checkbox type where I can check and uncheck?
Note: but only these two us.
Code Jsfiddle
2
I would like to know how I do so that the us Child 1
and the Child 2
be of the checkbox type where I can check and uncheck?
Note: but only these two us.
Code Jsfiddle
2
You can activate the option to use checkbox
in the plugin and hide with CSS those who are not descendants of .jstree-children
, example:
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"]
});
});
Browser other questions tagged jquery jstree
You are not signed in. Login or sign up in order to post.