Apply filter by clicking on value in column

Sep 10, 2022
Table builder, Admin panel

You can easily filter data in a table by clicking on a given value in cell, instead of opening filters and selecting value from there:

->tooltip('Filter by this person')
->extraAttributes(function (Settlement $record) {
return [
'wire:click' => '$set("tableFilters.users.values", [' . $record->user_id . '])',
'class' => 'transition hover:text-primary-500 cursor-pointer',

tableFilters.users.values - "users" is your filter name and depending on whether your filter allows multiple values to be selected values should be replaced by value and the field value should be passed as array or not

No comments yet…