-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] EnhancedChoiceType #3456
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
Comments
@bschussek what do you think about it ? |
The first point is already possible by using the "group_by" option of EntityType. As for the second, I need to research whether this is possible, but it should be. |
Ah, I misread. So you want to extend ChoiceType. What's the use case for a tree-like choices array? (I assume you don't talk about option groups right?) |
OptGroups are good to group choices and are usable too. But in tree of choices root elements have to be selectable too. In optgroup this is not possible, as they are only labels. Here are some common use cases:
To make tree of choices more visually attractive, javascript can be used to hide nested choices (and show them only when parent is selected), to select all child choices when parent is selected. Of course, this is task for programmer, not for the FormComponent. Anyway, more important is to have choices with custom attributes. |
@pulzarraider Thanks for your feedback. I created two new issues for these feature requests (see above). Please check them if they fit your needs. |
Now Form's ChoiceType accept only key=>value array and can render only simple list of choices without any parameters or additional informations.
It would be great if there will be EnhancedChoiceType which will accept more complicated array of values (key, label, custom attributes, level etc.).
EnhancedChoiceType will be used to render:
This issue is reopening #2754 as I think forms should deal with this by default.
The text was updated successfully, but these errors were encountered: