lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
944 stars 74 forks source link

Example for drag and drog with controlled tree? #269

Closed andreash closed 7 months ago

andreash commented 1 year ago

Lukas - I like your tree - great job!

Is your feature request related to a problem? Please describe. I am trying to implement a controlled tree with drag and drop and was looking for examples.

Describe the solution you'd like An example for drag and drop for controlled trees.

Best, Andreas

lukasbach commented 1 year ago

Maybe not the best example in terms of documentation, but maybe looking at the implementation of UncontrolledTreeEnvironment (https://github.com/lukasbach/react-complex-tree/blob/main/packages/core/src/uncontrolledEnvironment/UncontrolledTreeEnvironment.tsx) might be helpful - it essentially is just a wrapper around a controlled tree that provides pre-defined implementations for all necessary handlers.

lukasbach commented 7 months ago

I expanded the docs on static data providers and on custom data providers, maybe that gives some additional help when implementing dnd with custom data.

SyedMisbahUrRehman commented 3 months ago

Dear @lukasbach , can you please provide a minimal reproducible example for demonstration of Controlled tree environemt . Thansk a lot!

Misbah

lukasbach commented 3 months ago

Hi @SyedMisbahUrRehman, the docs on controlled environments have several examples for how to implement them: https://rct.lukasbach.com/docs/guides/controlled-environment