Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded lists and actions #174

Open
sicarionox opened this issue Feb 18, 2020 · 2 comments
Open

Embedded lists and actions #174

sicarionox opened this issue Feb 18, 2020 · 2 comments

Comments

@sicarionox
Copy link

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.

@alterphp
Copy link
Owner

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 ?

@kconde2
Copy link

kconde2 commented Mar 8, 2020

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 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants