Ian
Ian

Reputation: 900

jstree hide child checkboxes and only show parent checkboxes

Is it possible to do this in CSS - I have tried a couple of things below which do not quite work. Basically I need to display checkboxes at the Parent level and hide all children, I have tried the following:

    .jstree-children > .jstree li.jstree-open >a.jstree-anchor >  i.jstree-checkbox { display:none;  }

    .jstree li.jstree-open   > a.jstree-anchor >  i.jstree-checkbox { display:none;  }

Any ideas??

Upvotes: 3

Views: 2944

Answers (1)

Nikolay Ermakov
Nikolay Ermakov

Reputation: 5061

Do it this way:

  1. Add "state":{ "checkbox_disabled": true } to the children
  2. Add this to your css: .jstree-anchor > .jstree-checkbox-disabled { display: none; }

Check fiddle: Fiddle

Upvotes: 6

Related Questions