joaocarmo/react-smart-data-table

How to view 'No records available' as a row if data object is empty ?

tony-stark001 opened this issue · 1 comments

Currently the column headers are disappearing if data object is empty. I want column headers fixed, if empty data object provided. Also how to view 'No records found' text if data object is empty. ?

The newly released v0.6.5 should address the second issue. You can now pass any renderable object to the prop emptyTable which will be presented whenever there is no data. Please, try it in the live demo.

Regarding the first issue, I'll keep this open and think about it. Though I'm inclined to not implement such a thing, because if the table is supposed to be smart and infer the column names from the data and there is no data, then there can be no headers (there's no information to be used to create them). The solution would be to supply your own information of default headers and for that, there are many better tables out there.

TL;DR
The first issue goes against the essential philosophy of a smart data table.