Actions
Action groups

Actions are classified into four types:
main
item
subitem
bulk
Built-in actions
The grid package provides the following built-in actions:
create
main
update
item, bulk
delete
item, bulk
show
item
apply_transition
item, bulk
Create
Update
Delete
Show
Creating a custom Action
There are certain cases when built-in action types are not enough.
All you need to do is create your own action template and register it for the sylius_grid.
In this example, we will specify the action button's icon to be mail and its colour to be purple inside the template.
Now configure the new action's template like below in config/packages/sylius_grid.yaml:
From now on, you can use your new action type in the grid configuration!
Let's assume that you already have a route for contacting your suppliers, then you can configure the grid action:
OR
Creating a custom Bulk Action
In some cases, forcing the user to click a button for each item in a grid isn't practical. Fortunately, you can take advantage of built-in bulk actions. However, these may not always be sufficient and might need customization.
To do this, simply create your own bulk action template and register it inside the sylius_grid.
In the template we will specify the button's icon to be export and its colour to be orange.
Now configure the new action's template:
From now on, you can use your new bulk action type in the grid configuration!
Let's assume that you already have a route for exporting by injecting ids. Now, you can configure the grid action:
OR
Last updated
Was this helpful?