fsi-open/datagrid-bundle — pull request #24 by norzechowicz (2013-05-31 14:11:52+00:00)
Title: Added datagrid_column_type_action_cell_action_widget to twig

``datagrid_column_type_action_cell_action_widget`` is somethig that allows theming single actions in ``action`` column type.

Lets asume we have action ``edit``.
Up to now to create such actions the following configuration of action column type was required:

```
$datagrid->addColumn('actions', 'action',array(
'label' => "Actions",
'field_mapping' => array('id'),
'actions' => array(
'edit' => array(
'url_attr' => array(
'class' => 'btn btn-warning btn-small-horizontal',
'title' => 'crud.list.datagrid.action.edit'
),
'content' => '',
'route_name' => 'fsi_admin_crud_edit',
'parameters_field_mapping' => array(
'id' => 'id'
),
)
)
));
```

From now it also can be done by:

```
$datagrid->addColumn('actions', 'action',array(
'label' => "Actions",
'field_mapping' => array('id'),
'actions' => array(
'edit' => array(
'route_name' => 'fsi_admin_crud_edit',
'parameters_field_mapping' => array(
'id' => 'id'
),
)
)
));
```

with following block in DataGrid theme template file:

```
{# Resources/views/datagrid.html.twig #}

{% block datagrid_column_type_action_cell_action_edit %}
{% spaceless %}

{% endspaceless %}
{% endblock %}
```

``url_attr`` and ``content`` options are still available in action configuration.