Hi team,
We have three tables that display different types of data. It’s possible that, at times, some of these tables may be empty. When that happens, the column headers also disappear.
Is there a way to keep the column headers visible and simply display an empty message such as “No records” instead?
Have you see this, by chance?
Specify the columns in the table props. By default, the headers are from the returned data. But you can also specify the columns in Props.columns Only the columns you list there will show (useful when you want a subset of the columns to be displayed, but want to hide say, the “id” column)
^^ ignore that. I thought it worked, but I just tested and nope.. no data, no headers.
Could always tweak your binding to include a transform that looks at the data, and if there's no rows, adds a row with "No data returned" but does include your headers so they show up. (tested that and it does work)
Hi,
I am using this to show the message “No record“ but i want keep showing the column headers.
I’ve ran into this issue a couple of times in my past role. Unfortunately, don’t have that code anymore so I wrote up a quick example of how I worked it out.
Could not figure out how to get it done too cleanly so basically what it does is just swap out your actual table with a hard-coded ‘empty table’ that has one row, so the columns appear, and the basis cranked very low so that the only thing that appears is the table header. Below that I just add a label with the empty message.
view.json (16.8 KB)