F
Filamentβ€’2y ago
GavTheDev

Add a letter navigation bar on list page

I'm looking to add some filtering on the first letter of a record's title. I can add a dropdown to the filters but I prefer to have it always available above the table as A-Z buttons. What would be a good approach? Or where should I look for inspiration? I'm just looking for some pointers in the right direction πŸ€“
16 Replies
DivDax
DivDaxβ€’2y ago
Checkt out the render hooks resource.pages.list-records.table.start https://filamentphp.com/docs/2.x/admin/appearance#render-hooks
Filament
Appearance - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
GavTheDev
GavTheDevOPβ€’2y ago
Yeah, sorry, I wasn't clear. I know about the render hooks, the question is really about the filtering functionality, not how to get the actual bar above the table. But I appreciate the reply! πŸ˜…
DivDax
DivDaxβ€’2y ago
Write a custom filter and set the filter to "always show"?
GavTheDev
GavTheDevOPβ€’2y ago
Hm could it be that simple?
DivDax
DivDaxβ€’2y ago
the filters can be shown at pageloage
GavTheDev
GavTheDevOPβ€’2y ago
I'll look into that, thanks!
DivDax
DivDaxβ€’2y ago
instead of a dropdown which opens after click
GavTheDev
GavTheDevOPβ€’2y ago
Not sure what the option 'always show' would be. There's no mention of such an option in the docs (afaics) 🧐 There IS an option to show filters above the content, but that applies to all filters (oh that's what you posted πŸ˜… )
DivDax
DivDaxβ€’2y ago
DivDax
DivDaxβ€’2y ago
update table filter
->extraAttributes([
'wire:click' => '$emit("filterUpdate", "is_admin")',
'class' => 'transition hover:text-primary-500 cursor-pointer',
]),
->extraAttributes([
'wire:click' => '$emit("filterUpdate", "is_admin")',
'class' => 'transition hover:text-primary-500 cursor-pointer',
]),
GavTheDev
GavTheDevOPβ€’2y ago
Awesome, thanks! πŸ’ͺ
DivDax
DivDaxβ€’2y ago
No prob Maybe mark the thread als solved πŸ˜‰
GavTheDev
GavTheDevOPβ€’2y ago
We're not there yet πŸ˜‰ But will do once I got it working!
DivDax
DivDaxβ€’2y ago
Aaaand maybe build a package out of it? πŸ˜… https://github.com/filamentphp/plugin-skeleton
GitHub
GitHub - filamentphp/plugin-skeleton: A package skeleton for develo...
A package skeleton for developing Filament plugins. - GitHub - filamentphp/plugin-skeleton: A package skeleton for developing Filament plugins.
GavTheDev
GavTheDevOPβ€’2y ago
Noob question but how do I mark it as solved? πŸ˜… The green check?
Want results from more Discord servers?
Add your server