minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.
MIT License
516 stars 69 forks source link

Is there any way where we can add the radio button group for the nodes. #207

Closed nilesh2b closed 1 year ago

nilesh2b commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

minop1205 commented 1 year ago

@nilesh2b I think there are some ways to do this, but can you give me a concrete image of the screen? I may be able to provide a sample.

nilesh2b commented 1 year ago

As you see in the screenshot there are two value drivers but I am not able to create the two different radio button groups, there is single radio selection for entire list. Please suggest!

minop1205 commented 1 year ago

@nilesh2b As for radio buttons, they are not provided as a function of the treeview, but can be implemented by implementing logic outside of the treeview.

The sample below is an example of displaying sibling nodes as a single radio group.

https://codesandbox.io/s/radio-group-ts-rrvz3w?file=/src/App.tsx

I hope this is helpful.

nilesh2b commented 1 year ago

@minop1205 This is perfect example. thanks a ton for saving the day.

nilesh2b commented 1 year ago

@minop1205 Can we have default checked radio button for each group?