Skip to main content

CnMassExportDialog

Export format selection dialog. Lets users pick a format and triggers export for selected items.

Try it

Loading CnMassExportDialog playground…

Wraps: NcDialog, NcButton, NcSelect

CnMassExportDialog showing export format selection

Props

PropTypeDefaultDescription
dialogTitleString'Export objects'
descriptionString''Optional description text shown above the format selector
formatsArray[{ id: 'excel', label: 'Excel (.xlsx)' }, { id: 'csv', label: 'CSV (.csv)' }]Available export formats as [{ id, label }] objects
defaultFormatString'excel'ID of the format selected by default
successTextString'Export completed successfully.'Message shown in the result phase on success
formatLabelString'Export format'Label above the format selector
cancelLabelString'Cancel'
closeLabelString'Close'Label for the close button shown in the result phase
confirmLabelString'Export'

Events

EventPayloadDescription
confirm\{ ids, format \}Export confirmed
closeDialog closed

Public Methods

MethodDescription
setResult(\{ success?, error?, data? \})Set export result

Live demo

<template>
<div>
<button @click="open = true" style="padding: 6px 16px; border-radius: 4px; background: var(--color-primary-element); color: white; border: none; cursor: pointer;">Export</button>
<CnMassExportDialog
v-if="open"
ref="dlg"
@confirm="onConfirm"
@close="open = false" />
</div>
</template>
<script>
export default {
data() { return { open: false } },
methods: {
async onConfirm(payload) {
await new Promise(r => setTimeout(r, 800))
this.$refs.dlg.setResult({ success: true })
},
},
}
</script>

Usage

<CnMassExportDialog
:items="selectedItems"
:formats="['json', 'csv', 'xlsx']"
@confirm="onExport"
@close="showExport = false" />

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnMassExportDialog.vue and update automatically whenever the component changes.

Props

NameTypeRequiredDefaultDescription
dialogTitlestring() =&gt; t('nextcloud-vue', 'Export objects')Dialog title
descriptionstring''Description text shown above the format selector
formatsarray[ \{ id: 'excel', label: 'Excel (.xlsx)' \}, \{ id: 'csv', label: 'CSV (.csv)' \}, ]Available export formats
defaultFormatstring'excel'Default selected format ID
successTextstring() =&gt; t('nextcloud-vue', 'Export completed successfully.')Success message
formatLabelstring() =&gt; t('nextcloud-vue', 'Export format')
cancelLabelstring() =&gt; t('nextcloud-vue', 'Cancel')
closeLabelstring() =&gt; t('nextcloud-vue', 'Close')
confirmLabelstring() =&gt; t('nextcloud-vue', 'Export')

Events

NamePayloadDescription
close
confirm

Methods

NameDescription
setResultSet the result of the export operation.