From f083d2ab2d1cb4103420c496724cd72145fc4b24 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 14 Jun 2022 10:26:18 +0100 Subject: [PATCH] Fixed #2630 - DataTable: Header columns and row columns doesn't resize together with Virtual Scroller and resizable columns --- src/components/datatable/DataTable.vue | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 1148c516c..69523da94 100755 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -27,7 +27,7 @@ @column-click="onColumnHeaderClick($event)" @column-mousedown="onColumnHeaderMouseDown($event)" @filter-change="onFilterChange" @filter-apply="onFilterApply" @column-dragstart="onColumnHeaderDragStart($event)" @column-dragover="onColumnHeaderDragOver($event)" @column-dragleave="onColumnHeaderDragLeave($event)" @column-drop="onColumnHeaderDrop($event)" @column-resizestart="onColumnResizeStart($event)" @checkbox-change="toggleRowsWithCheckbox($event)" /> - - { + !!el && (el.style.width = el.style.minWidth = tableWidth); + } + + updateTableWidth(this.$refs.table); + + if (!this.virtualScrollerDisabled) { + const body = this.$refs.bodyRef && this.$refs.bodyRef.$el; + const frozenBody = this.$refs.frozenBodyRef && this.$refs.frozenBodyRef.$el; + + updateTableWidth(body); + updateTableWidth(frozenBody); + } this.resizeTableCells(newColumnWidth); }