Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

How to create Dynamic Drop in OneToMany Relationship?

$
0
0

Diocese:

iddiocese_name
1DJ
2Kpg

OneToMany

Parish:

iddiocese_idparish_name
11St. Jude
21St. Mark
32St. Peter
42St. thomas

I want to make a drop down dynamic:when the user clicks on Diocese name, It should Display the related Parish Name.

I tried with Form Event, but I couldn't follow the documentation.Here is the Code.

$builder->add('diocese_name', EntityType::class,['class' => 'App\Entity\Diocese','choice_label' => 'diocese_name']);$builder->addEventListener(    FormEvents::PRE_SET_DATA,    function(FormEvent $event){         $form = $event->getForm();         $data = $event->getData();         $parish = $data->getParish();         dump($parish);    });

Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>