EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

[WIP] [RFC] Embedded crud in forms

Open psihius opened this issue 1 year ago • 2 comments

Note: this is a WIP and a Request For Comments aka feedback. This needs a lot more development, especially on making things work via AJAX and having a dedicated "embedded" layout, because right now it does not have as smooth functionality as it needs to. Also, a bunch of JS is commented out because I did not get to it yet. Filters are gonna be a major headache and probably would need improvements overall. This might turn into an epic of its own.

This is the ability to embed a whole data grid "index" page into a form via the EmbedField::new('relation')

This was based on #3543 PR, but a lot has changed since 3.x days and that PR needed a full re-work and bigger changes to the EA.

  • All actions happen by regular navigation - except paging nothing else is using AJAX and/or modals.
  • All actions use referrers, barring unusual circumstances, they should redirect back to the page you were on, anchors should work too ( # )
  • I have not tried adding filters at all, nor is JS code handling them anyway (commented out)
  • No handling for batched actions
  • Things that work: index page (grid), paged navigation, add, edit, delete, custom actions.

Lots to work on:

  • Search
  • Sorting
  • Filters
  • Batched actions
  • AJAX-based deleting
  • Modal based add/edit/custom actions
  • Move JS into it's own file to be included according to EA way

All feedback, patches and discussion are welcome. There's a wide field of discussion on how to approach this and implement it - I am thinking that we probably should have a dedicated embedded_layout form and have a dedicated template for the embedded grid rather than doing a single block render like it's doing now.

psihius avatar Jul 25 '24 09:07 psihius

@psihius can you please share a screenshot of how i looks like when we embed a data table in a form?

Seb33300 avatar Jul 30 '24 14:07 Seb33300

@psihius can you please share a screenshot of how i looks like when we embed a data table in a form? Screenshot from 2024-07-30 19-17-25

psihius avatar Jul 30 '24 16:07 psihius

@psihius anything new here? Wondering if you are still working on this feature...

Gorkyman avatar Nov 11 '24 19:11 Gorkyman

@psihius anything new here? Wondering if you are still working on this feature...

It's been a bit on the backburner due to other priorities. I do use this functionality in production, so as soon as something breaks - I will handle it, and probably then also devote some time to develop it forward. Which actually might be even this month because I plan a big infra update and that means updating to latest Symfony for the project I'm using this in and that means bump to latest easyadmin and there are already conflicts... soo... soon^tm? :D

psihius avatar Feb 06 '25 10:02 psihius

is there an easy way to inject this mod to test it? I'm trying to make the changes locally (not in vendors) so I don't break updates while I wait for this to be accepted. But I'm having a hard time trying to extend a few of them injected values like the template additions to AbstractCrudController.

This is a very important addition why is it taking so long to add this?

EDIT: Oh part of my issue is that I want this is details not form, this seems to only do forms :(

dt-justin avatar Jul 16 '25 14:07 dt-justin