I cannot Google for it or find it here or in the docs.
How can I display a loading icon when Table is loading data? How to track its state?
Version: 9.21.0
UPDATE. Also, which is quite related: how to show no data row?
Answering to myself. Well, I missed the property doing exactly what I want. It's called noRowsRenderer and can be used like this:
<Table
...
noRowsRenderer={() => <Loader/>
In my real code I use additional state propery - loading, which indicates whether the data request has been dispatched or not:
<Table
...
noRowsRenderer={() => (loading ? <Loader/> : null)}
Its initial value is true, and initial data propery (rowGetter target) is [].
One the request is completed, I set loading to false.
Most helpful comment
Answering to myself. Well, I missed the property doing exactly what I want. It's called
noRowsRendererand can be used like this:In my real code I use additional state propery -
loading, which indicates whether the data request has been dispatched or not:Its initial value is
true, and initial data propery (rowGettertarget) is[].One the request is completed, I set
loadingtofalse.