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

Field actions in details #6708

Open
KDederichs opened this issue Jan 13, 2025 · 0 comments · May be fixed by #6722
Open

Field actions in details #6708

KDederichs opened this issue Jan 13, 2025 · 0 comments · May be fixed by #6722

Comments

@KDederichs
Copy link
Contributor

Short description of what this feature will allow to do:
Allow attaching actions to specific fields to be rendered in the detail view.

Example of how to use this feature
If you have an a entity with a lot of custom actions they start cluttering the menu REALLY fast making it hard to navigate them.
As such it would be great if you could attach actions to specific fields, so they'd be rendered below the field value on the details page.

This would allow the developer to break up and place the actions anywhere in the view (real field or virtual field) and would allow for greatly improved UI building since you don't have to cram every action into the menu anymore.

As for how to attach them, I'd say there's two possibilities here:

  1. Expand the Actions:add method with an optional 3rd parameter for the field:
$actions->add(Crud::PAGE_DETAIL, $myAction, 'foo');
  1. Define the actions by names when defining the fields:
TextField::new('foo')->setActions(['fooAction','barAction']);

After an action is attached to a field in such a way it should move out of the header and into the detail view.

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

Successfully merging a pull request may close this issue.

1 participant