OganM
OganM

Reputation: 2663

Change default behavior on click for jstree

I am using jstree to create a tree without checkboxes. In such a tree a click selects one node of the tree and deselects all others. To select multiple nodes one has to do ctrl + click (as examplified by the jstree demo). Is there a way to change this default to the more similar to checkbox default, which is click to select, click again to deselect?

Upvotes: 0

Views: 786

Answers (1)

Adam
Adam

Reputation: 2666

If you're ok with using checkboxes and your only reservation is the dependence on one another, try using the checkboxes plugin but set "three_state" to false.

From JSTree:

$.jstree.defaults.checkbox.three_state: a boolean indicating if checkboxes should cascade down and have an undetermined state. Defaults to true.

Upvotes: 1

Related Questions