Adding elements to the tree
See original GitHub issueHello, I tested the demo with adding elements, everything works great.
But this addition works on the button. The task is this:
- There is a simple html tree without d
n
d - There is your tree.
- I need to implement adding elements from the first tree to yours using d
n
d
The point of the idea is that there is no need to remove an element from the first tree. The first tree is like a set of features. When dragging a feature onto your tree, I need to figure out what level I’m at and add a new element based on the dragged feature.
How can this be implemented?
Is it possible to use the react-dnd library for the first tree, and when dragging onto your tree, I could understand to which level I dragged an element from the first list?
Or do I need to create a custom node and wrap it additionally in react-dnd?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Insertion in a Binary Tree in level order - GeeksforGeeks
Given a binary tree and a key, insert the key into the binary tree at the first position available in level order. Recommended:...
Read more >Insertion(Adding a new Node) in a Binary Tree Data Structure
Step 1: Create a function to insert the given node and pass two arguments to it, the root node and the data to...
Read more >Adding Elements to a Binary Search Tree - YouTube
0:03 - Algorithm for adding elements0:19 - Adding 7, 5, 6, 9, 3, & 8 to a BST1:05 - The shape of the...
Read more >inserting a node in a binary search tree - Log2Base2
inserting a node in a binary search tree · 1. Create a new BST node and assign values to it. · 2. insert(node,...
Read more >Insertion into a B-tree - Programiz
Inserting an element on a B-tree consists of two events: searching the appropriate node to insert the element and splitting the node if...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That is correct. This is because at this time it is not possible to detect events when external elements are dragged.
I have released v3.0.0 today.
In this version, you can now drop elements outside the tree and drag & drop between trees.
See the README and samples for details.
README
https://github.com/minop1205/react-dnd-treeview#external-drag-source
Demo and Examples (Storybook)
https://minop1205.github.io/react-dnd-treeview/
(See stories below)