Remove All Filters button

Hi Guys, I have my table filters set up with a couple of toggle buttons, these contain basic options such as "This Month", "Year to Date", "Last Year", and "All dates" My problem comes in when the user clicks the "Remove All Filters" button at the top of the table. (It renders with a little x button in the top right once there are indicators present for the filters) I have the "All Dates" toggle set up with ->default() and this works on first load. But it's not selected after pressing remove all filters? I realise that this is probably intended behaviour, but is there a way for me to hide this button? Or programatically toggle this filter option after the button is pressed? I already have this indicator set the not be removeable:
->indicateUsing(function (array $data): Indicator {

if (empty($data['note_date_from']) && empty($data['note_date_until'])) {
return Indicator::make('Showing All Dates')->removable(false);
}

return Indicator::make(
'Created from ' . Carbon::parse($data['note_date_from'])->toFormattedDateString() .
' to ' . Carbon::parse($data['note_date_until'])->toFormattedDateString()
)->removable(false);

})
->indicateUsing(function (array $data): Indicator {

if (empty($data['note_date_from']) && empty($data['note_date_until'])) {
return Indicator::make('Showing All Dates')->removable(false);
}

return Indicator::make(
'Created from ' . Carbon::parse($data['note_date_from'])->toFormattedDateString() .
' to ' . Carbon::parse($data['note_date_until'])->toFormattedDateString()
)->removable(false);

})
Thanks in advance
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server