Skip to content

Export column picker ​

A pre-export dialog for choosing which columns go into the file.

Open in demo
Open in demo

Usage ​

columns is { key, label }[]. confirm carries the chosen keys, and the dialog closes itself with it.

The keys come back in the order of the columns array, not the order they were ticked, so the exported file matches the table on screen.

Everything starts ticked each time the dialog opens. That is the common case, and it means the usual path is one press.

DataTableExport drives this dialog, so a table's export menu already offers it. Use it directly where you are exporting something that is not a DataTable.

API ​

Source: src/shared/components/common/ExportColumnPicker.vue

Props ​

PropTypeDefaultDescription
openbooleanrequiredYou own it.
columns{ key: string, label: string }[]requiredThe columns to offer, in export order. A label can be a translation key or a literal.

Emits ​

EventPayloadDescription
update:openvalue: booleanFrom Cancel, Escape, the overlay, and after a confirm.
confirmkeys: string[]The chosen keys, in the order of columns.

Slots ​

None.

Accessibility ​

  • Each checkbox is inside a <label>, so the whole row is the hit area and the column's name is the checkbox's name.
  • The confirm button counts what is selected, "Export 4 columns", so the outcome is stated before it happens. It is singular at one.
  • With nothing selected the confirm button is genuinely disabled, so an empty file cannot be produced.
  • The list scrolls inside the dialog at up to 288 pixels, so a wide table's column list never pushes the footer off the screen.