solid-ui
solid-ui copied to clipboard
Improving the ergonomics of the data table
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.
- Improve the dropdown for hiding/showing columns.
To do this, we can add a
getAllHeadersusing table features so that when we want to get the dropdown for showing/hiding, we can just dotable.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. - 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.
Thanks for the feedback :)
- I'll have a look at this. Especially since it feels like a super simple improvement.
- I want to port the v1 of https://ui.bazza.dev/docs/data-table-filter to SolidUI. Would that already solve this point?
- 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.