-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] adding the ChoiceView as a var for expanded choices sub forms #5286
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
Thank you for taking the time to report this issue! What information does ChoiceView provide that you cannot access via FormView? See also #4171. |
This information is the ChoiceView's 'data' property. In my use case, it was an entity type, so this property contained an So in my custom theme when iterating over the forms I was expecting a |
I had a similar task and managed to get the corresponding entity in
(Disclaimer: Maybe I included mistakes; didn’t remember my GitHub password and thus couldn’t login from work.) |
Description: Because some times is usefull to add some attributes to select's options. Exemple when using, select2, chosen, or juste by adding some prototypes. | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#5286 | License | MIT
Description: Because some times is usefull to add some attributes to select's options. Exemple when using, select2, chosen, or juste by adding some prototypes. | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#5286 | License | MIT
Description: Because some times is usefull to add some attributes to select's options. Exemple when using, select2, chosen, or juste by adding some prototypes. | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#5286 | License | MIT
Any news on this problem? |
ping @webmozart |
I was unable to access this way: |
His solution worked perfectly for me : |
I think this is a duplicate of #5489. |
I'm having some difficulties to do a custom rendering for expanded choices. I'm using an entity type wich is ordering entities by a relation table, and for each different relation I have to do a group of chexkboxes, with another one at the top allowing to select all or none of the group.
My issue is that I can't do the correlation between the form views and choice views. So I think it's really complicated to do custom rendering on expanded choices.
I'm suggesting to pass the ChoiceView as a var for each choice subForm so that when iterating on the choice formview we can get access to the choice view data, giving more information to be able to render custom stuffs (when the original data is an object).
The text was updated successfully, but these errors were encountered: