Hello everyone.
First, thanks for this fantastic piece of code.
I found a possible bug or - if not - a missing feature to the
hierarchical mode behaviour.
As far as I can tell, currently in selectMode 3, a parent node is
selected when all the children nodes are selected. If I deselect a
children node, the parent node (and the parent's parent, and so on) are
deselected and indicated via the "square checkbox" icon (nice visual
feature). But in the getSelectedNodes result, those partially selected
nodes aren't included. This is as expected, isn't it?
Anyway, the current behaviour implies that we should post-process the
keys that a user select in the tree adding the parents that he forgot
(the application that will receive the data needs data that way).
We tried to fiddle a bit with the onSelect handler, but it didn't work
as we expected as - of course - a "select" operation issued in the
onSelect handler (although on different nodes) creates all sorts of
undesirable side effects.
Any idea on how to solve this? Any possible idea of introducing another
selectMode (4) such as "multi-select with OR parent selection" (as I
could say that now the parent selection uses AND, as a parent is
selected only when ALL children are selected)? Or (better) an (optional)
argument to getSelectedNodes indicating that partially selected nodes
should be retrieved as well?
Thanks in advance
--
Alessandro Malgaroli
ISMB
mail:
malg...@ismb.it
Corso Castelfidardo 30
Torino, ITALY