Data table cell with empty data

I really like the data table cell. I currently have an example where depending on certain inputs, the data consumed by the cell may be empty; how do I protect the data table in this case, so that it simply doesn’t show, rather than return Error: invalid data source?

If the data is created by a JS cell, make it return a placeholder dataset instead of undefined?

For example:

dataNotNull = data ?? Object.assign([], {columns: ["a", "b", "c"]})

Thanks; it will do for now, though it’s a bit hacky!

If you want to get even more hacky you can make your data cell return arbitrary output, e.g.

data = ({queryTag: () => [], query: () => htl.html`<span style="font:13px var(--sans-serif)">No results`})

Not advisable though if you have downstream cells, and certainly not supported in any way. :slight_smile:

2 Likes