# ListViewActions

There are two type of events: download and event.

# Example

Route: /<entity>/metadata

{
  "columns": [
    /* ... */
  ],
  "permissions": {
    "action": {
      /* ... */
    }
  },
  /* These are actions that the user has permissions to execute */
  "actions": [
    {
      "id": "ExportCsv",
      "label": "common.action.csvExport",
      "type": "download",
      "icon": "fa-file-export"
    },
    {
      "id": "ImportCsv",
      "label": "common.action.csvImport",
      "type": "event",
      "icon": "fa-file-import"
    }
  ]
}

# Download

When the type is download, it will call /<entity>/execute/<id>. E.g. /translations/execute/export-csv

WARNING

For type download the id is always formatted to kebab-case.

# Event

When the type is event, a list-view-action-clicked event will be emitted. Its payload is the action object from the actions array above. You need to subscribe to this event (and also unsubscribe) and implement a manual action afterwards, e.g. opening a custom modal.

Example: https://jdi-backoffice-test.jdi.nl/translations