Here, I have a code in React. I want to show dashed lines on the left of the tree.
How can I do that?
I need something like this:
And, I want to merge the style of TreeView with this code:
const StyledTreeItem = withStyles((theme) => ({
iconContainer: {
'& .close': {
opacity: 0.3,
},
},
group: {
marginLeft: 2,
paddingLeft: 3,
borderLeft: `1px dashed ${fade(theme.palette.text.primary, 0.4)}`,
},
}))((props) => <TreeItem {...props} />);
"organizationalUnitsList": [
{
"organizationalUnitId": "",
"organizationalUnitName": "A",
"organizationalUnitsList": [
{
"organizationalUnitId": "",
"organizationalUnitName": "b",
}
]
},
{
"organizationalUnitId": "",
"organizationalUnitName": "C",
"organizationalUnitsList": [
{
"organizationalUnitId": "",
"organizationalUnitName": "D",
"organizationalUnitsList": [
{
"organizationalUnitId": "",
"organizationalUnitName": "e",
}
]
}
]
},
{
"organizationalUnitId": "",
"organizationalUnitName": "f"
}
]
Now, I want TreeView to not show borderBottom at OrganizationalUnitName as 'A','C' and 'D'. Because they will be acting as a parent of their child. I want child to show borderBottom not the parent.
There are multiple organizationalUnitId. But whenever array of objects appears, I want objects to appear as a child not the parent.
How can I do that?