EasyAdminBundle
EasyAdminBundle copied to clipboard
Fix: sorting by specific field of the AssociatedField #4307
By default, the sorting with AssociatedField is with the id.
This PR introduces sorting by specific field of the AssociatedField.
Exemple of usage:
public function configureFields(string $pageName): iterable
{
return [
TextField::new('first', 'Prénom'),
TextField::new('last', 'Nom'),
EmailField::new('email', 'Email'),
AssociationField::new('company', 'Structure')
->setSortBy('company.name')
->autocomplete()
->setRequired(true)
]);
}
https://user-images.githubusercontent.com/40602497/115112470-fc762500-9f85-11eb-9102-9639b9beaa81.mov
Fix: #4307