diff --git a/src/components/datatable/HeaderCell.vue b/src/components/datatable/HeaderCell.vue index 2a32d7d75..8cdb2ecf8 100644 --- a/src/components/datatable/HeaderCell.vue +++ b/src/components/datatable/HeaderCell.vue @@ -165,6 +165,13 @@ export default { } this.styleObject.left = left + 'px'; } + + let filterRow = this.$el.parentElement.nextElementSibling; + if (filterRow) { + let index = DomHandler.index(this.$el); + filterRow.children[index].style.left = this.styleObject.left; + filterRow.children[index].style.right = this.styleObject.right; + } } }, onHeaderCheckboxChange(event) { diff --git a/src/components/datatable/TableHeader.vue b/src/components/datatable/TableHeader.vue index e3de5f5f0..3bb49a185 100755 --- a/src/components/datatable/TableHeader.vue +++ b/src/components/datatable/TableHeader.vue @@ -120,7 +120,9 @@ export default { return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; }, getFilterColumnHeaderClass(column) { - return ['p-filter-column', this.columnProp(column, 'filterHeaderClass'), this.columnProp(column, 'class')]; + return ['p-filter-column', this.columnProp(column, 'filterHeaderClass'), this.columnProp(column, 'class'), { + 'p-frozen-column': this.columnProp(column, 'frozen') + }]; }, getFilterColumnHeaderStyle(column) { return [this.columnProp(column, 'filterHeaderStyle'), this.columnProp(column, 'style')]; diff --git a/src/components/treetable/BodyCell.vue b/src/components/treetable/BodyCell.vue index ad276c6e0..2993a8553 100644 --- a/src/components/treetable/BodyCell.vue +++ b/src/components/treetable/BodyCell.vue @@ -121,7 +121,7 @@ export default { }, computed: { containerClass() { - return [this.columnProp('bodyClass'), { + return [this.columnProp('bodyClass'), this.columnProp('class'), { 'p-frozen-column': this.columnProp('frozen') }]; }, diff --git a/src/components/treetable/FooterCell.vue b/src/components/treetable/FooterCell.vue index e9477aa6e..84b31c01e 100644 --- a/src/components/treetable/FooterCell.vue +++ b/src/components/treetable/FooterCell.vue @@ -59,7 +59,7 @@ export default { }, computed: { containerClass() { - return [this.columnProp('footerClass'), { + return [this.columnProp('footerClass'), this.columnProp('class'), { 'p-frozen-column': this.columnProp('frozen') }]; }, diff --git a/src/components/treetable/HeaderCell.vue b/src/components/treetable/HeaderCell.vue index b2a850f8a..e8e78d30d 100644 --- a/src/components/treetable/HeaderCell.vue +++ b/src/components/treetable/HeaderCell.vue @@ -79,6 +79,13 @@ export default { } this.styleObject.left = left + 'px'; } + + let filterRow = this.$el.parentElement.nextElementSibling; + if (filterRow) { + let index = DomHandler.index(this.$el); + filterRow.children[index].style.left = this.styleObject.left; + filterRow.children[index].style.right = this.styleObject.right; + } } }, onClick(event) { @@ -114,7 +121,7 @@ export default { }, computed: { containerClass() { - return [this.columnProp('headerClass'), { + return [this.columnProp('headerClass'), this.columnProp('class'), { 'p-sortable-column': this.columnProp('sortable'), 'p-resizable-column': this.resizableColumns, 'p-highlight': this.isColumnSorted(), diff --git a/src/components/treetable/TreeTable.vue b/src/components/treetable/TreeTable.vue index 80be66ee4..ed981a996 100755 --- a/src/components/treetable/TreeTable.vue +++ b/src/components/treetable/TreeTable.vue @@ -264,6 +264,16 @@ export default { this.d_multiSortMeta = newValue; } }, + mounted() { + if (this.scrollable && this.scrollDirection !== 'vertical') { + this.updateScrollWidth(); + } + }, + updated() { + if (this.scrollable && this.scrollDirection !== 'vertical') { + this.updateScrollWidth(); + } + }, methods: { columnProp(col, prop) { return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; @@ -739,6 +749,9 @@ export default { }, hasGlobalFilter() { return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global'); + }, + updateScrollWidth() { + this.$refs.table.style.width = this.$refs.table.scrollWidth + 'px'; } }, computed: {