F
Filament4mo ago
EDZero

[Filament v4] Filtering TableSelect with Tabs

Hi all 👋 I’m using Filament v4 and I’d like to display tabs above a TableSelect field to filter the selectable records. The goal is to let users click a tab (e.g. event category) and have the TableSelect update its query accordingly. Here is what I have done so far:
Step::make('Choose Template')
->schema([
TableSelect::make('template_id')
->relationship('template', 'id')
->hiddenLabel()
->tableConfiguration(TemplatesTable::class)
]),
Step::make('Choose Template')
->schema([
TableSelect::make('template_id')
->relationship('template', 'id')
->hiddenLabel()
->tableConfiguration(TemplatesTable::class)
]),
I’ve tried using ->aboveContent() to show the tabs, but I’m not sure how to connect the selected tab to the query inside the TableSelect's tableConfiguration. Is there a correct way to: 1. Add tabs above a TableSelect, and 2. Use the selected tab value to filter the query (in getTableQuery() or similar)? Any guidance or examples would be appreciated! Thanks 🙏
8 Replies
Boa Hancock
Boa Hancock4mo ago
You meant something like this?
No description
Kenneth Sese
Kenneth Sese4mo ago
Or maybe like this? Coming to AdvancedTables v4
Boa Hancock
Boa Hancock4mo ago
awesome man, i love it; can you drop repo ?
Kenneth Sese
Kenneth Sese4mo ago
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!
Boa Hancock
Boa Hancock4mo ago
The tab part is done with Advanced Tables (formerly Filter Sets)? Thanks boss
Kenneth Sese
Kenneth Sese4mo ago
Yes
EDZero
EDZeroOP4mo ago
No description
EDZero
EDZeroOP4mo ago
Sorry, I forgot to attach the design, this is what I want, simple tabs for TableSelect form field.

Did you find this page helpful?