EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Fix: sorting by specific field of the AssociatedField #4307

Open lpetic opened this issue 4 years ago • 0 comments

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

lpetic avatar Apr 17 '21 12:04 lpetic