F
Filament4mo ago
Maxime

Default sort direction on table groups

Is there a way to define the default sort direction on table groups?
// Exemple where it makes more sense to sort by descending order by default
Tables\Grouping\Group::make('priority')
->orderQueryUsing(function (Builder $query, string $direction) {
$query->orderByRaw('FIELD(priority, "low", "medium", "high") ' . $direction);
})
// Exemple where it makes more sense to sort by descending order by default
Tables\Grouping\Group::make('priority')
->orderQueryUsing(function (Builder $query, string $direction) {
$query->orderByRaw('FIELD(priority, "low", "medium", "high") ' . $direction);
})
  Also, is it possible to disable the ordering for some groups?
0 Replies
No replies yetBe the first to reply to this messageJoin