For defaultSort() which accepts a string, is there an easy way to sort by multiple columns?
->defaultSort("title") // group.group, sort_order
4 Replies
I'm not sure there's an easy solution for this... you can probably override the
applyDefaultSortingToTableQuery()
method on your Page or custom component.
Easy enough I guess πDo you have an example how to use that? I couldn't find that method defined anywhere. I'll keep looking.
Something like this on your page class:
I don't know if it's going to work everywhere, but something to experiment π
This is not working for me (filament 3)
Method 'App\Filament\Resources\MyCountryResource\Pages\ListMyCountries::applyDefaultSortingToTableQuery()' is not compatible with method 'Filament\Resources\Pages\ListRecords::applyDefaultSortingToTableQuery()'.intelephense(P1038)
any other ideas?