symfony - Clearing form collection entirely -


i have issue symfony 2.6 form collections. removing elements collection works, when @ least 1 present. if last element removed dom (leaving collection container empty), no elements removed collection after handling request.

example:

i have form collection "children" , 2 children, "a" , "b". remove child "b" dom, save, removechild called, child removed. remove child "a", save, nothing happens - after refreshing form child still present. when dumping main entity after form has handled request, child present in it's collection well.

did have similar problem , found solution?

you can 2 methods :

but don't forget cascade={"remove"} annotation


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -