-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow hiding action buttons while maintaining DefaultRowAction functionality #7511
Copy link
Copy link
Open
Milestone
Description
Short description of what this feature will allow to do:
Currently, to use an action as a setDefaultRowAction(), that action must be present (and visible) on the Index page. If a developer wants the "click-to-edit" behavior without actually showing an "Edit" button in the actions column, they must currently use CSS (like d-none) to hide the button. This feature would introduce a built-in PHP method (e.g., displayAsHidden()) that renders the action's metadata/URL for JavaScript functionality but prevents it from being rendered as a visible button or link in the UI.
Example of how to use this feature
This would allow for a clean "click-only" interface without manually injecting CSS or overriding templates:
public function configureCrud(Crud $crud): Crud
{
return $crud->setDefaultRowAction(Action::EDIT);
}
public function configureActions(Actions $actions): Actions
{
// Create an action that exists but isn't visible as a button
$editHidden = Action::new(Action::EDIT)
->displayAsHidden(); // Proposed method
return $actions
->add(Crud::PAGE_INDEX, $editHidden);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels