diff --git a/api-generator/components/column.js b/api-generator/components/column.js index 8df610148..9f538a3fe 100644 --- a/api-generator/components/column.js +++ b/api-generator/components/column.js @@ -233,6 +233,12 @@ const ColumnProps = [ default: "true", description: "Whether the column is included in data export." }, + { + name: "exportHeader", + type: "string", + default: "null", + description: "Custom export header of the column to be exported as CSV." + }, { name: "hidden", type: "boolean", diff --git a/src/components/column/Column.d.ts b/src/components/column/Column.d.ts index 4b75ebfc8..4b99d80d1 100755 --- a/src/components/column/Column.d.ts +++ b/src/components/column/Column.d.ts @@ -229,6 +229,10 @@ export interface ColumnProps { * Whether the column is included in data export. */ exportable?: boolean | undefined; + /** + * Custom export header of the column to be exported as CSV. + */ + exportHeader?: string | undefined; /** * Defines the filtering algorithm to use when searching the options. */ diff --git a/src/components/column/Column.vue b/src/components/column/Column.vue index b557e8522..752f2b305 100755 --- a/src/components/column/Column.vue +++ b/src/components/column/Column.vue @@ -162,6 +162,10 @@ export default { type: Boolean, default: true }, + exportHeader: { + type: String, + default: null + }, filterMatchMode: { type: String, default: null diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index ab153f8e6..262eff038 100755 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -1033,7 +1033,7 @@ export default { else headerInitiated = true; - csv += '"' + (this.columnProp(column, 'header') || this.columnProp(column, 'field')) + '"'; + csv += '"' + (this.columnProp(column, 'exportHeader') || this.columnProp(column, 'header') || this.columnProp(column, 'field')) + '"'; } } diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue index 1b3340078..6e36b8994 100755 --- a/src/views/datatable/DataTableDoc.vue +++ b/src/views/datatable/DataTableDoc.vue @@ -373,6 +373,12 @@ export default { true Whether the column is included in data export. + + exportHeader + string + null + Custom export header of the column to be exported as CSV. + filterMatchMode string diff --git a/src/views/datatable/DataTableExportDemo.vue b/src/views/datatable/DataTableExportDemo.vue index 8c178983b..95597a4a8 100755 --- a/src/views/datatable/DataTableExportDemo.vue +++ b/src/views/datatable/DataTableExportDemo.vue @@ -16,7 +16,7 @@