EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

allow to add custom query params for autocompleteEnpointUrl

Open erelke opened this issue 2 years ago • 3 comments

Allow to add custom query params for autocomplete in AssociationField.

yield AssociationField::new('something')->autocomplete(['key' => 'value']);

erelke avatar Jun 23 '22 15:06 erelke

What is the usecase?

michaelKaefer avatar Aug 13 '22 12:08 michaelKaefer

@michaelKaefer Is usefull if you need to filter your autocomplete results. Example: If you have User entity, and in one page you need enabled users, in second page you need womans, in third you need admin users. In this case you can pass the needed filter.

erelke avatar Aug 13 '22 14:08 erelke

I think you can already use AssociationField::new('...')->setQueryBuilder(...) for this or am I missing something?

michaelKaefer avatar Aug 13 '22 21:08 michaelKaefer