frontend-collective / react-sortable-tree

Drag-and-drop sortable component for nested data and hierarchies
https://frontend-collective.github.io/react-sortable-tree/
MIT License
4.9k stars 897 forks source link

How to add more details in the nodes of an organization chart? #919

Open danieldan979 opened 2 years ago

danieldan979 commented 2 years ago

I need to implement a company diagram with drag and drop functionality. I found the react-sortable-tree library and tried using it for my purpose. This is what I have done so far:

image

Now I stopped and this is my question: is it possible to add more details within each node (e.g. email, mobile number ...)? The node should look like this:

image

Thanks in advance!

alexuong commented 2 years ago

Were you able to figure out if this is possible?

KunwarVSuryavanshi commented 2 years ago

This can be achieved if we pass our own component or html code to title of generateNodeProps. Although if you are going to increase the height of input box, you might ran into problem of the side lines connecting them not aligned properly.

Which also can be corrected (hopefully) by overwriting styling of .rstlineBlock, .rstabsoluteLineBlock.

Or simply increasing rst_node will also do the work