Grid view loses headers
https://filamentphp.com/docs/3.x/tables/layout#arranging-records-into-a-grid
When i use the grid layout, then the table loses the headers.
In my case, I need to show to the user the field names of the values that are being shown in each record in the grid
for example:
table mode:
in grid mode:
in this grid mode, the user has to remember which field name is which one, otherwise they see only numbers
so id like to achieve something like this:
should i use an infolist for that somehow? what should i do?
11 Replies
so far im thinking of putting a tooltip each field with it's key, not sure though
Not sure whether this will work or not cause i've never try grid table, but you can tweak like this maybe
yeah well for simple text columns it'll do it, but in reality i have a lot of diff types of columns and this wont solve it. in the example i just did it with simple texts to create a minimal example
Then I think you need to follow this https://filamentphp.com/docs/3.x/tables/layout#custom-html
hmm prolly that is a way yeah thanks. i think ill build a custom view. but if there are other ways let me know π , cuz this one seems it adds a lot of complexity, i have to control it everything in the view & customize it a lot
Yeah sure, but I think grid table isn't design for what you expected
cuz this one seems it adds a lot of complexityI didn't see the complexity, all you have to do is define one view file, and inside the view, place data how you'd like to display, that's all... you don't need to create different views for different columns cause you got the whole record so one view file is enough for one resource
yeah maybe. i thought like a grid view of some sort of infolists
but i mean, for example, lets say i have a toggle column, how do i put it in a custom view while letting it to work? is that possible
and idk, badge columns, yeah i can replicate them i guess inspecting the code and copying the html structure & css but idk π€·ββοΈ
i feel i'll struggle trying to set it all up
or maybe not but idk how to achieve it so far yet & gotta dig deeper
Oh.. I'll struggle too if I try to make toggle π€£ but for badge, you can simple copy paste this (https://filamentphp.com/docs/3.x/support/blade-components/badge)
Overall I'll use normal table if I need some extra works (like toggle) and use grid to display only some data and handle everything in form
Checkout this Blade components (https://filamentphp.com/docs/3.x/support/blade-components/overview) it's easy to copy-pase if custom views is needed
yeah that is cool, defo this is the workaround i think yeah
so thanks again, u gave some path to me to follow!