Hi,
I'm running PF 6.2.3 and I have a tree with selectionMode="single".
I can select an item with a simple click but the only way I found to deselect it is to do Ctrl-click.
Is there a way to change that? Ideally, a click on a tree node would toggle its selection state.
Thanks!
François
Tree with selectionMode single: toggle selection on click?
The source is open: https://github.com/primefaces/primefaces/blob/master/
The Tree js source is here: https://github.com/primefaces/primeface ... ee/tree.js
The code that handles the nodeClick is here: https://github.com/primefaces/primeface ... ee.js#L279
The line that checks for a metakey and only unselect then is on: https://github.com/primefaces/primeface ... ee.js#L297
That variable is set on https://github.com/primefaces/primeface ... ee.js#L290
Selection with a metakey also works as can be deduced from the code, so giving it a fixed value will solve your problem.
If you create a stackoverflow question, I'm more than happy to create an answer for you there (and then also here )
The Tree js source is here: https://github.com/primefaces/primeface ... ee/tree.js
The code that handles the nodeClick is here: https://github.com/primefaces/primeface ... ee.js#L279
The line that checks for a metakey and only unselect then is on: https://github.com/primefaces/primeface ... ee.js#L297
That variable is set on https://github.com/primefaces/primeface ... ee.js#L290
Selection with a metakey also works as can be deduced from the code, so giving it a fixed value will solve your problem.
If you create a stackoverflow question, I'm more than happy to create an answer for you there (and then also here )
Not everything is possible without changes to code. Your'e the first one that requested this. You can ofcourse make a patch the makes it configurable in the xhtml on the component and file a pull request. Then it might get incorporated in the next release.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 32 guests