mttt
mttt
FFilament
Created by ericmp on 7/5/2024 in #❓┊help
Collapse All Table Row Groups By Default
No description
27 replies
FFilament
Created by ericmp on 7/5/2024 in #❓┊help
Collapse All Table Row Groups By Default
Me and @Min Min Tun faced a similar issue and found a quick solution by extending the Filament vendor file vendor/filament/tables/resources/views/components/group/header.blade.php. Then replace
@if ($collapsible)
x-on:click="toggleCollapseGroup(@js($title))"
@endif
@if ($collapsible)
x-on:click="toggleCollapseGroup(@js($title))"
@endif
with
@if ($collapsible)
x-init="collapsed = @js($title) ? toggleCollapseGroup(@js($title)) : false"
x-on:click="collapsed = !collapsed; toggleCollapseGroup(@js($title))"
@endif
@if ($collapsible)
x-init="collapsed = @js($title) ? toggleCollapseGroup(@js($title)) : false"
x-on:click="collapsed = !collapsed; toggleCollapseGroup(@js($title))"
@endif
This ensures that all groups are collapsed by default.
27 replies