Embedded lists and actions
Hello,
sorry in advance if this has just been an oversight from my side, but how exactly are actions set for items in embedded lists? For instance, if I have an order edit page with an embedded list of products belonging to said order, each list item only has an edit action which leads to the edit page of the item itself. I, for example, would like to have a remove option that would only remove the product item from the order I'm editing, but for the love of me, I could not make anything like that work when editing the .yaml file. Am I overseeing something very simple, or is it simply not possible and I'd have to achieve that by overriding the embedded list template?
Thanks for the answer(s) in advance. If anything isn't clear, I'll gladly provide more information.
Hi @sicarionox !
delete action has been specifically removed from embedded lists (see https://github.com/alterphp/EasyAdminExtensionBundle/blob/master/src/Resources/views/default/embedded_list.html.twig#L73). It's due to the implementation of delete action as a form.
Embedded list are often inserted into some forms (edit views) so they cannot have <form> themselves. Delete action must be implemented as an AJAX call in embedded lists. This could be a nice add to the extension bundle by the way.
Is it more clear now ?
Cool feature I was wondering why it wasn't natively added. @alterphp is there already someone working on this ? Maybe I can help to implement this 😎