Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding interactions to a tree node. #13

Unanswered
ManiBharath asked this question in Q&A
Discussion options

Hey I'm trying to develop a hierarchical tree structure using the package react-complex-tree https://github.com/lukasbach/react-complex-tree.

I'm using multiple trees in my project and the template for nodes in the first tree is different from the others. I tried and added buttons against each node to prepare some interactions like deleting the node and more. The problem here comes after that, when ever I drag and drop a node the onClick() function for that button gets triggered. I don't understand why this is happening, can anyone help me with this?

Also I want to set a depth limit to the tree, any ideas how I can achieve that?

You must be logged in to vote

Replies: 1 comment

Comment options

You could try to implement your own InteractionMode to have better control over events do what (see https://rct.lukasbach.com/docs/guides/interaction-modes). Do you have an example for that?

Regarding the depth limit, you could for example use a custom data provider, and in the ondidChangeTreeData method conditionally decide whether you want to allow the action or not (see https://rct.lukasbach.com/docs/guides/custom-data-provider).

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /