F
Filament3mo ago
Xavi

Another button on modal filter

Hello It's possible to add another button on table filter to show/hide some group of filters? For example, i have a form with default filters, and i want to create a button to hide default filters and show advanced filters Thank you so much!
4 Replies
LeandroFerreira
LeandroFerreira3mo ago
Custom filter forms? https://filamentphp.com/docs/3.x/tables/filters/custom#custom-filter-forms
Filter::make('custom_filter')
->form([
Toggle::make('advanced')
->live(),

Group::make([
Select::make('filter1'),
Select::make('filter2'),
])->hidden(fn (Get $get): bool => $get('advanced')),

Group::make([
Select::make('filter3'),
Select::make('filter4'),
])->visible(fn (Get $get): bool => $get('advanced'))
])
Filter::make('custom_filter')
->form([
Toggle::make('advanced')
->live(),

Group::make([
Select::make('filter1'),
Select::make('filter2'),
])->hidden(fn (Get $get): bool => $get('advanced')),

Group::make([
Select::make('filter3'),
Select::make('filter4'),
])->visible(fn (Get $get): bool => $get('advanced'))
])
Xavi
Xavi3mo ago
thanks @Leandro Ferreira but now when advanced form its showed it doesn't take all modal width (as image attach). How can i do this?
No description
LeandroFerreira
LeandroFerreira3mo ago
columnSpanFull in the Group?
Xavi
Xavi3mo ago
it use ->filtersFormSchema and it works perfect! Thanks a lot @Leandro Ferreira