Creating custom Bulk Action
There are cases where pressing a button per item in a grid is not suitable. And there are also certain cases when built-in bulk action types are not enough.
All you need to do is create your own bulk action template and register it for 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 like below in the config/packages/sylius_grid.yaml
:
config/packages/sylius_grid.yaml
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, then you can configure the grid action:
Last updated