How do I transfer my component?
nodeContentRenderer(data) {
return (
<div>
nodeContentRenderer
</div>
);
}
Sorry, I did not see the prompt react-sortable-tree.js. Everything cool
Hi @batazor ,
Actually I am geting some difficulty to understand react-sortable-tree.js.
So can you please provide some code snippet to use nodeContentRenderer .
Thanks,
@anil1712 As an example https://gist.github.com/batazor/df66fb09d7c963755e38454f85c65591
Take as an example of a component https://github.com/fritz-c/react-sortable-tree/blob/5f29231db2a1f32f1e04aca634778a11f6449f66/src/node-renderer-default.js
@fritz-c and @batazor I am having the Tree Data in below format. (eg. {name: ..., users: [ ... ]})
My JSON format:
[ { 'id': '1', 'name': 'Value1', 'users': [ { 'name': 'Value2', }, { 'name': 'Value3', 'users': [ { 'name': 'Value4', } ] }, { 'name': 'Value4', 'users': [ { 'name': 'Value5', } ] }, { 'name': 'Value5', }, { 'name': 'Value6', 'users': [ { 'name': 'Value7', } ] } ] } ]
Can you please tell me what is the best way to convert it into required TreeData format
(like {title: ..., children:[ ... ]})
Can I use nodeRenderer to render the tree without changing the JSON key or else I have to change the format of my JSON?
@fritz-c Please provide some suggestion.
Thanks.
@fritz-c can you please provide some snipped for nodeContentRenderer to render any kind of JSON format.
Please help me to out of it.
@anil1712 Did you figure this out? I need some help too on this
@fgiarritiello please check out #53 for the answer to anil1712's question.
Thanks @fritz-c
Could you please also share some guidance on how to use nodeContentRenderer?
Thanks
Most helpful comment
Thanks @fritz-c
Could you please also share some guidance on how to use nodeContentRenderer?
Thanks