Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select node with child #9

Open
RightChain opened this issue Jun 17, 2022 · 5 comments
Open

Cannot select node with child #9

RightChain opened this issue Jun 17, 2022 · 5 comments

Comments

@RightChain
Copy link

RightChain commented Jun 17, 2022

I want to be able to select just one node that may or may not have children and only return that node.

Two issues:

  1. With "multiple" set to FALSE, multiple children will be returned when selecting a node.
  2. When I want to select a node but not its children, all of the children are selected and returned rather than the node.

Is there a way to determine the actual node that was selected when the selected node has children?

@stla
Copy link
Owner

stla commented Jun 18, 2022

Hello,

Please next time use StackOverflow for questions like this.

I'm not sure to understand your question. you want to select a parent node without selecting its children?

@RightChain
Copy link
Author

Basically I want to select a directory from a file tree. If it has children, then there is no guaranteed way to select only the directory due to how the selection propagates.

@stla
Copy link
Owner

stla commented Jun 30, 2022

Ok. Indeed, the selection always "cascades" to the children nodes. But you can attach some data to the nodes, e.g. type="folder" and type="file", and then filter the selection. But yes, the children will be selected, visually speaking.

@RightChain
Copy link
Author

Right, but I want to be able to select a "folder" that contains another "folder." Is there a way to change how the selection "cascades"?

@stla
Copy link
Owner

stla commented Jun 30, 2022

No, but that's not a problem. Each folder will have the "attribute" type="folder", and you filter all nodes which have this attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants