Hi! I came across this (old) thread in a Google Search. I hope it's okay to re-open the discussion.
This is still my desire, as well. I am trying to get this behavior with the latest version 3.3.3. I am using:
'checkbox' : {
'three_state' : true,
},
Everything works as desired, except that selecting all siblings in a tree auto-selects their parent node.
I am using this in a filemanager application. Two use-case examples:
1. I want the user to be able to select and move all files in /Temp/, without also being forced to move the (parent) /Temp/ directory itself.
2. Given a tree like this:
/SomeDir/
+-- File1
+-- File2
+-- Child1/
+-- File3
+-- File4
I want the user to be able to select and all the files (File1,File2,File3,File4) without being forced to also select the directories SomeDir/ and Child1/
But I want this without losing other behaviors that "cascade up". Deselecting any child node, no matter how deep, should still de-select all it's ancestors up to the root (the way it does now). "If any of my descendants are unselected, then I am unselected."
Currently, if the user has a selected hierarchy, then user can click a descendant node (deselecting its ancestors), and then just click that node again, and get back to where they started (because that 2nd click will cascade up and re-select all parents). I want to specifically break this two-click symmetry. If my user deselects any child (or deeper-level) descendant, the user will need to manually re-select each of node's ancestors up to the topmost node -- or, more easily, just re-select the topmost node again (thus selecting all descendants again). This allows the user to easily say, "Give me all this stuff, except for these one or two exceptions" -- and also not be forced into selecting the parents.
I am going to dig into the code now, to examine the checkbox plugin and maybe write a new plugin that works the way I want.
But if there is more general interest, I could also code this as a new option to the existing plugin and submit a Pull Request. Maybe something like forceParentSelect: false.
Thanks,
Derek Simkowiak