Custom table columns per table tab
I'm moving from Nova, and basically want to replicate what a Lense does in Filament.
So when I switch to my "Pending Payments" tab, I want to also add a column showing "payment total".
Is this at all possible? Or do I need to have separate pages/tables linked to these tabs?
Solution:Jump to solution
So the filament version of a lens would be using filter tabs on the "ListRecords" page class: https://filamentphp.com/docs/3.x/panels/resources/listing-records#using-tabs-to-filter-the-records
On your columns you can use a callback in hidden() to inject $livewire which will give you the instance of ListRecords, you can then use that to check the current tab.
Let's say you have the following on the ListRecords page:...
3 Replies
Welcome to the Darkside!
So it is possible, you can custom code it or just use a premium plugin....
https://filamentphp.com/plugins/kenneth-sese-advanced-tables#toggling-and-reordering-columns-new
Filament
Advanced Tables (formerly Filter Sets) by Kenneth Sese - Filament
Supercharge your tables with powerful features like user customizable views, enhanced filter tabs, reorderable columns, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Solution
So the filament version of a lens would be using filter tabs on the "ListRecords" page class: https://filamentphp.com/docs/3.x/panels/resources/listing-records#using-tabs-to-filter-the-records
On your columns you can use a callback in hidden() to inject $livewire which will give you the instance of ListRecords, you can then use that to check the current tab.
Let's say you have the following on the ListRecords page:
On a table you could do the following to make the 'active' column only show on the all tab:
Awesome, thanks guys for the answers. I'll go with the custom code one for now, but that plugin definitely looks functionality packed.π