Skip to content

Option to filter choices #32657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xabbuh opened this issue Jul 22, 2019 · 4 comments · Fixed by #35733
Closed

Option to filter choices #32657

xabbuh opened this issue Jul 22, 2019 · 4 comments · Fixed by #35733

Comments

@xabbuh
Copy link
Member

xabbuh commented Jul 22, 2019

This is a global feature request replacing several more specific requests in the past. Basically the idea is to have a new choice_filter option that allows to filter the list of choices.

see #11847, #14072 for example

@ro0NL
Copy link
Contributor

ro0NL commented Jul 22, 2019

so we need a decision for #28624, which exactly implements this choice_filter 😅

i sense some skepticism to handle this in memory, compared to providing an optimized choice_loader. However for the "intl choice types" the choice_loader is predefined and hard to modify.

Also i'd argue one should ever pass a choice loader to the intl types, given those types should manage the data/choices for us. We only want want modify this list with filters and ordering.

@yceruto
Copy link
Member

yceruto commented Jul 22, 2019

I think this choice_filter option makes sense only for intl types.

@fancyweb
Copy link
Contributor

fancyweb commented Jan 24, 2020

+1 to @yceruto. Having this filter option makes sense, but only on form types that you don't control and that force the choices. Adding it to ChoiceType would be contradictory since you already control the choices.

@ro0NL
Copy link
Contributor

ro0NL commented Jan 24, 2020

Adding it to ChoiceType would be contradictory since you already control the choices.

well, Intl types are also ChoiceType, but with a managed choice_loader. Conceptually this situation can apply to many predefined choice types; a generic choice_filter could be useful for any of those.

But i agree providing the right choices/choic_loader is best, while adding a type specific choice_filter option per case (in case the choice loader is managed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants