F
Filament3mo ago
Arjen

Change table columns/filters based on active tab?

Is it possible in panels to show or hide specific table columns or filters based on the active tab?
Solution:
Tables\Columns\TextColumn::make()
->visible(fn($livewire) => $livewire->activeTab == $your_tab);
Tables\Columns\TextColumn::make()
->visible(fn($livewire) => $livewire->activeTab == $your_tab);
...
Jump to solution
3 Replies
Solution
Jordy
Jordy3mo ago
Tables\Columns\TextColumn::make()
->visible(fn($livewire) => $livewire->activeTab == $your_tab);
Tables\Columns\TextColumn::make()
->visible(fn($livewire) => $livewire->activeTab == $your_tab);
Jordy
Jordy3mo ago
should work for filters aswell, $livewire injects the livewire component https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-livewire-component-instance
Arjen
ArjenOP3mo ago
Thanks!

Did you find this page helpful?