3

How can i update the content of a specific form field inside an admin interface from Sonata Admin based on another form field ?

An example : i have an entity Contract ManyToOne Client, Users ManyToOne Client, Users ManyToOne Product. When i choose a Contract in form (select input) i want my product select updated with only related products. I know how to create a custom query but not how to bind it via ajax.

I could do it without any problem outside sonata admin but don't know how inside it.

Thanks!

Arnaud Janssens
  • 150
  • 1
  • 12

1 Answers1

0

You can't really do it (or atleast I still haven't found a way to do it).

They best way to do it (or how I do it) is to overwrite the view, create your own custom form and work with ajax from there.

Baba Yaga
  • 1,819
  • 15
  • 20