Open AndrewBoklashko opened 1 year ago
Just found that I can use filteredRowsCount
callback to solve my problem. Still think that having onDisplayDataChange
prop would be useful for other scenarios and for better developer's experience. However feel free to close this issue if you consider it's not worth it.
Any updates?
I am implementing a feature similar to CSV export, as described in docs. The issue is that I need to disable "Export CSV" button when data grid has no displayed data, can be when user filters did not match any record. With suggested approach this is not possible, because
gridRef.current.data
is not reactive.My suggestion is to have a callback prop:
onDisplayDataChange(data: any[])
, which will provide same data asgridRef.current.data
. This way developers can operate with the actual data, displayed on the grid in a reactive manner. Also code will be cleaner, because ref will no longer be required.Somewhat related issue, developer is doing a combination of
filter
function andonFilterValueChange
to get filtered rows. But this will approach with not work with remotedataSource
.Thanks in advance!