Posted 4 June 2018, 6:05 pm EST
We started to use TreeView combined with checkboxes (autoCollapse=false), which basically works, but we prefer to also support clicking on the text LABEL of the node to toggle the checkbox state, because it reduces the precision required from human mouse navigation.
My first attempt, was adding a custom event listener on the “itemClicked” attribute from the TreeView, and at first sight, this worked fine.
However, clicking on the arrow left to expand/collapse, ALSO fires the event handler and toggles the state. This is NOT what we intended, because in our opinion, this should ONLY expand/collapse without toggling the checkbox state.
Tried to remediate it by adding a “onCollapsedChanged” handler to “cancel” the event, but that did not have the intended effect.
Anything else I should try to reach our intended UI behavior?
Some other “solutions” I have in mind:
- adding click handler on the label ONLY (span class=“wj-node-text”)
- avoid propagating click event to surrounding DIV in case expand/collapse
Many thanks in advance!
Tung
–
Mazda Logistics Europe