Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I "check/uncheck" nodes "child/parent" independently in JSTree?

I need that the parents and children nodes can be checked independently. For instance, if my tree has one node with child, the comportment is:

If I check this child, automatically the parent will be checked too, or vice versa. I wanna can check a child or parent and do not change the other.

How can I "remove" this dependency of both?

Any help is appreciated.

Thank advance!

like image 775
fdam Avatar asked Jan 23 '26 11:01

fdam


1 Answers

I found the answer for my question in own jstree site:

link

two_state A boolean. Default is false. If set to true checkboxes will be two-state only, meaning that you will be able to select parent and children independently and there will be no undetermined state.

So, I solved my question putting the option below:

"checkbox" : { 
    "two_state" : true
}

Att

like image 119
fdam Avatar answered Jan 25 '26 01:01

fdam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!