support
support copied to clipboard
`clearChildren` does not convert parent to leaf when convertEmptyParentToLeaf is enabled
Hello,
We are currently running into an issue with the tree node functionality in the Gantt.
Our use case: We have a list of top-level parent nodes that are loaded at the start.
They are assumed to have children under them, but they may not. We do not load the children under them initially to save on performance.
The route we decided on is to utilize on demand loading when expanding the node, and then appending the children to the node.
Problem Encountered: The issue we're coming across is on expansion when the parent node is deemed to not have any children. If we detect there are no children to load, we want to be able to turn the parent node into a leaf.
I've had a look at the documentation and can see that the 'isLeaf' property is Readonly and only has a getter.
I've also tried setting other properties like 'children' to false and 'leaf' to true, but it seems like everything is being driven by 'isLeaf'. This is problematic for our use case.
Is there another method where we can toggle on demand for a node to be a leaf? If this is not possible, as an alternative we would need some way to hide the expand/collapse icon on demand.
Thank you,
OnePlan Team