From cfa4b06c036790ef6ceb004fe3d966275a1bb71e Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Fri, 14 May 2021 15:30:49 +0300 Subject: [PATCH] Fixed #956 - Possibility to define column visibility --- api-generator/components/column.js | 7 +++++ src/components/column/Column.d.ts | 1 + src/components/column/Column.vue | 4 +++ src/components/datatable/TableBody.vue | 4 +-- src/components/datatable/TableFooter.vue | 4 +-- src/components/datatable/TableHeader.vue | 6 ++-- src/components/treetable/TreeTable.vue | 36 +++++++++++++---------- src/components/treetable/TreeTableRow.vue | 30 ++++++++++--------- src/views/datatable/DataTableDoc.vue | 6 ++++ src/views/treetable/TreeTableDoc.vue | 6 ++++ 10 files changed, 68 insertions(+), 36 deletions(-) diff --git a/api-generator/components/column.js b/api-generator/components/column.js index 6c7775830..8df610148 100644 --- a/api-generator/components/column.js +++ b/api-generator/components/column.js @@ -232,7 +232,14 @@ const ColumnProps = [ type: "boolean", default: "true", description: "Whether the column is included in data export." + }, + { + name: "hidden", + type: "boolean", + default: "false", + description: "Whether the column is rendered." } + ]; const ColumnSlots = [ diff --git a/src/components/column/Column.d.ts b/src/components/column/Column.d.ts index 5831a2fa2..be3b315ed 100755 --- a/src/components/column/Column.d.ts +++ b/src/components/column/Column.d.ts @@ -40,6 +40,7 @@ interface ColumnProps { alignFrozen?: string; exportable?: boolean; filterMatchMode?: string; + hidden?: boolean; } declare class Column { diff --git a/src/components/column/Column.vue b/src/components/column/Column.vue index b4c6548b2..b557e8522 100755 --- a/src/components/column/Column.vue +++ b/src/components/column/Column.vue @@ -165,6 +165,10 @@ export default { filterMatchMode: { type: String, default: null + }, + hidden: { + type: Boolean, + default: false } }, render() { diff --git a/src/components/datatable/TableBody.vue b/src/components/datatable/TableBody.vue index 792b363fd..0c7c1d739 100755 --- a/src/components/datatable/TableBody.vue +++ b/src/components/datatable/TableBody.vue @@ -15,7 +15,7 @@ @click="onRowClick($event, rowData, index)" @dblclick="onRowDblClick($event, rowData, index)" @contextmenu="onRowRightClick($event, rowData, index)" @touchend="onRowTouchEnd($event)" @keydown="onRowKeyDown($event, rowData, index)" :tabindex="selectionMode || contextMenu ? '0' : null" @mousedown="onRowMouseDown($event)" @dragstart="onRowDragStart($event, index)" @dragover="onRowDragOver($event,index)" @dragleave="onRowDragLeave($event)" @dragend="onRowDragEnd($event)" @drop="onRowDrop($event)" role="row">