react-dropdown-tree-select - Get all selected values
mahesh-insight opened this issue · 3 comments
In several places, I saw your @mrchief resolution comment.
Really Appreciate it.
Assign node paths to your tree via an [HOC] - I am done with this point.
Take the node path (any extra props on the node object are returned as is) to grab the children from your input data.
Not getting this actually. How to check the specific value from the node path.
Note - The Tree Data comes from the API.
On the selection of the parent element - AKS - I need the related children value - deploymentNode
It's only returning the _rdts...nodenames, where I need to value name.
Reference - https://codesandbox.io/s/amazing-goodall-dkxt45
I am looking for a positive revert.
Thanks for the kind words! You're mostly on track. What you're missing is the piece that connects node paths to your original data
. The idea is that you take the nodepath from the event object, and use it to locate the node within your own data.
Any fields prefixed with an underscore are internal and you should not rely on them. However, any custom props you pass are always bubbled back, like your bread
prop. So pass nodePath
as an additional prop and when you get that back, you can use to look it back up.
We are using the dynamic API for the tree data.
What I have done -
- On the change of dropDown - passes the selected nodes and the whole endpoint data.
- Then two different array objects are taken - one for the parent (when the parent label is selected and returns all its children, and the second one for the children's selected value (when the children are selected).
- On the selection of parent label - takes that value and scans in the whole endpoint data - and returns the related children when it matches.
- At last concat those two arrays.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.