EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

ID Field as clickable link to open detail action

Open plandolt opened this issue 3 years ago • 7 comments

ID Field as clickable link to open detail action.

plandolt avatar Dec 21 '21 22:12 plandolt

Hi. Are you checking the permissions to view the Details page? Maybe it is disabled?

izhddm avatar Dec 23 '21 14:12 izhddm

Thanks for this proposal. I like this feature and this was on my TODO list ... but I'd like the implementation to be different. I want to add a ->rowAction() method or something like that where you can define which is the action executed when clicking on the row. If you don't configure it, it links by default to edit or detail (the first action that it's enabled and you have permission to execute).

javiereguiluz avatar Dec 23 '21 19:12 javiereguiluz

Couple of questions regarding that:

  • The ->rowAction() would be for Crud in configureCrud, correct?
  • the whole tr should then be clickable, excluding any links of buttons, correct?
    • Follow up to this: Do you know a proper way to link on the whole tr? Should that be made with a data-href and js to make it work?
  • Should it really be automatically working or should it be opt-in?

Should I convert the current logic with a link to be more generic so that any field can be rendered as a link but you then need to provide the action or a url?

plandolt avatar Dec 24 '21 11:12 plandolt

WDYT @javiereguiluz ?

plandolt avatar Dec 31 '21 08:12 plandolt

Somehow related to this PR or the table row action: What about implementing both but make this PR more generic to allow create a link on any field (which does not create a link by itself like AssociationField? The link can either be an action, a route or a uri. WDYT @javiereguiluz ?

plandolt avatar Jan 04 '22 11:01 plandolt

Nice! I was planning on doing this PR myself but it's nice to see I'm not the only one wanting linkable ID. In the meantime, I put together a quick workaround directly in Twig: https://blog.eexit.net/link-id-fields-in-easyadmin/

I look forward this PR to being merged 🙏🏻 Thanks!

eexit avatar Jan 13 '22 09:01 eexit

See #5331 for a more generic version.

fabpot avatar Jul 13 '22 14:07 fabpot

Let's close this one in favor of a more generic solution like the one proposed in #5331. Thanks.

javiereguiluz avatar Sep 26 '22 17:09 javiereguiluz