StofDoctrineExtensionsBundle icon indicating copy to clipboard operation
StofDoctrineExtensionsBundle copied to clipboard

FormType for Tree

Open alvaroveliz opened this issue 14 years ago • 4 comments

Well, I think that I have an issue here. If the entity uses Tree, I cannot use a form with choices, because there are no form types able to render a tree choice. How can I build a form element which uses a Tree entity? is there anything like that?

alvaroveliz avatar Mar 16 '12 03:03 alvaroveliz

This tree choice field type implemented in my fork of this repo, but there are no pull request from me because it is not very good implementation yet. You can see my repo here: https://github.com/artseld/StofDoctrineExtensionsBundle . If you will use my bundle you need to additionally include jQuery library (manually or from another bundle which use it, e.g. SonataJQuery, etc.)

artseld avatar Mar 16 '12 08:03 artseld

@artseld The implementation seems indeed not so good. But I think the worse thing I saw in the diff is <?php used in a Twig template in many places :)

stof avatar Mar 16 '12 09:03 stof

@stof I'm sorry, it was a bad and unused template, it should not be commited =) Thank you, fixed already. If tree form view will be configurable in FormType (e.g., collapsed or expanded, expanded only if sub-items selected and etc.), it will be good?

artseld avatar Mar 16 '12 09:03 artseld

Thank both, I will test your implementation @artseld.

alvaroveliz avatar Mar 16 '12 13:03 alvaroveliz