Add code to datagrid remove action (list_remove)

What is the best option to add custom code to datagrid remove action, e.g. like a ‘preRemove’:

    <dataGrid id="myDataGrid"
              width="100%"
              minHeight="20em"
              dataContainer="myDc"
              columnReorderingAllowed="true">
        <actions>
            <action id="create" type="list_create"/>
            <action id="remove" type="list_remove"/>
        </actions>

There is an afterSaveHandler. Is there something similar for delete?

@Install(to = "departmentsTable.create", subject = "afterSaveHandler")
private void departmentsTableCreateAfterSaveHandler(final Department department) {
    notifications.create("Created " + department).show();
}

Hi,

Currently RemoveAction allows to set AfterActionPerformedEvent and ActionCancelledEvent handlers. If you need to set BeforeActionPerformedEvent handler, you need to override ActionPerformedEvent and use RemoveOperation directly. Here an example: io.jmix.securityflowui.view.resourcerole.ResourceRoleModelListView#onRoleModelsTableRemove

Regards,
Gleb