react-checkbox-tree
react-checkbox-tree copied to clipboard
Lazy loading child nodes when user clicks on expand icon.
Hi,
Is it possible to lazy loading child nodes when user clicks on expand icon? If yes, do you have any example for that?
Thanks, Arun
No, it is currently not possible. This is very similar to #43, which would basically only render the nodes when they are in view.
+1
You can pass an [{}] to the children property of a node so the caret will show. Then in your onExpand function you can set that node's children property to a node that has a label that displays loading to the user like this:
[{
label: (
<div className="children-are-loading">
<FontAwesomeIcon icon="spinner" spin />
<div className="children-are-loading__text">Loading your data...</div>
</div>
),
value: 'loading',
showCheckbox: false
}]