react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

Lazy loading child nodes when user clicks on expand icon.

Open apalanisamy opened this issue 8 years ago • 3 comments

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

apalanisamy avatar Nov 07 '17 15:11 apalanisamy

No, it is currently not possible. This is very similar to #43, which would basically only render the nodes when they are in view.

jakezatecky avatar Nov 08 '17 23:11 jakezatecky

+1

clayroach avatar Feb 20 '18 15:02 clayroach

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
}]

jonhill13 avatar Jan 10 '20 15:01 jonhill13