solid-ui icon indicating copy to clipboard operation
solid-ui copied to clipboard

Improving the ergonomics of the data table

Open MAST1999 opened this issue 8 months ago • 2 comments

I've been using @tanstact\table for a few years now, and I've found a few ways to make using it a lot more ergonomic.

  1. Improve the dropdown for hiding/showing columns. To do this, we can add a getAllHeaders using table features so that when we want to get the dropdown for showing/hiding, we can just do table.getAllHeaders().flatMap((hg) => hg.headers) and use that to render the dropdown. This means the columns definition is the source of truth, and we don't need to do anything else for this feature to work.
  2. Improve adding filters to columns. To enable this, we can add a filter to the column meta that can receive custom Solid components. This way they can colocate the filter with the column definition as well.

I can make a repo with these changes if people think this is a good idea.

MAST1999 avatar May 11 '25 00:05 MAST1999

Thanks for the feedback :)

  1. I'll have a look at this. Especially since it feels like a super simple improvement.
  2. I want to port the v1 of https://ui.bazza.dev/docs/data-table-filter to SolidUI. Would that already solve this point?

stefan-karger avatar May 12 '25 07:05 stefan-karger

  1. I want to port the v1 of ui.bazza.dev/docs/data-table-filter to SolidUI. Would that already solve this point?

That indeed does solve it. It just looked kinda heavy-handed.

What I had in mind was a direct integration with tanstack table but, I won't complain if I get this as well.

MAST1999 avatar May 12 '25 08:05 MAST1999