Filter Table using Action

Hi, guys. I added a button called " Show active properties? How can I change the table to contains only the activated properties?
8 Replies
ZedoX
ZedoXβ€’2y ago
1 - Make Tabler Filter for active 2 - You can trigger that filter when that button is clicked
DianaMujoiu
DianaMujoiuOPβ€’2y ago
Can I trigger the filter here?
DianaMujoiu
DianaMujoiuOPβ€’2y ago
I am asking because I don't know exactly how to trigger a filter
ZedoX
ZedoXβ€’2y ago
public function showActive(): void
{
// See what your tableFilters look like when active filter is on
// dd($this->tableFilters);

//Then just set it like this
$this->tableFilters['is_active']['value'] = true;
}
public function showActive(): void
{
// See what your tableFilters look like when active filter is on
// dd($this->tableFilters);

//Then just set it like this
$this->tableFilters['is_active']['value'] = true;
}
the example i have shown for a TernaryFilter
Tables\Filters\TernaryFilter::make('is_active'),
Tables\Filters\TernaryFilter::make('is_active'),
DianaMujoiu
DianaMujoiuOPβ€’2y ago
Works! Thank you πŸ™‚
DianaMujoiu
DianaMujoiuOPβ€’2y ago
I have one more question πŸ˜… . Is there a way to move those buttons in the table header?
ZedoX
ZedoXβ€’2y ago
yeah there are table header actions
DianaMujoiu
DianaMujoiuOPβ€’2y ago
thank you, again
Want results from more Discord servers?
Add your server