Filtering widget data with HasFiltersForm on view resource page

I'm trying to use the Filtering widget data with HasFiltersForm on view resource page (Infolist). I currently put the use Filament\Pages\Dashboard\Concerns\HasFiltersForm; trait, and put the filtersForm method:
public function filtersForm(Form $form): Form
{
return $form
->schema([
Section::make()
->schema([
DatePicker::make('startDate'),
DatePicker::make('endDate'),
// ...
])
->columns(3),
]);
}
public function filtersForm(Form $form): Form
{
return $form
->schema([
Section::make()
->schema([
DatePicker::make('startDate'),
DatePicker::make('endDate'),
// ...
])
->columns(3),
]);
}
But it doesn't show anything about the filter. How can I make it work in a view resource / Infolist page?
3 Replies
Miguilim
MiguilimOP2mo ago
It seems the problem is that I'm trying to use that in a infolist page, while the documentation shows an example using the dashboard page. What should I do?
awcodes
awcodes2mo ago
It’s only meant for dashboard pages. If you want to use it on a view page then you need to look into livewire events and listeners.
Abdellah Belkaid
@Miguilim Hello bro im facing the same issue have you found any solution?
Want results from more Discord servers?
Add your server