From 321479f13178fc493e887b8a5eb7c7b946ecefbf Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 9 Nov 2023 18:02:09 +0300 Subject: [PATCH] Fixed #4786 - DataTable/TreeTable: Frozen column improvements --- components/lib/datatable/BodyCell.vue | 4 ++-- components/lib/datatable/FooterCell.vue | 6 +++--- components/lib/datatable/HeaderCell.vue | 4 ++-- components/lib/treetable/BodyCell.vue | 6 +++--- components/lib/treetable/FooterCell.vue | 6 +++--- components/lib/treetable/HeaderCell.vue | 4 ++-- components/lib/utils/DomHandler.js | 28 +++++++++++++++++++++++++ components/lib/utils/Utils.d.ts | 2 ++ 8 files changed, 45 insertions(+), 15 deletions(-) diff --git a/components/lib/datatable/BodyCell.vue b/components/lib/datatable/BodyCell.vue index 362da1760..ff3cf5499 100755 --- a/components/lib/datatable/BodyCell.vue +++ b/components/lib/datatable/BodyCell.vue @@ -450,7 +450,7 @@ export default { if (align === 'right') { let right = 0; - let next = this.$el.nextElementSibling; + let next = DomHandler.getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); if (next) { right = DomHandler.getOuterWidth(next) + parseFloat(next.style.right || 0); @@ -459,7 +459,7 @@ export default { this.styleObject.right = right + 'px'; } else { let left = 0; - let prev = this.$el.previousElementSibling; + let prev = DomHandler.getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); if (prev) { left = DomHandler.getOuterWidth(prev) + parseFloat(prev.style.left || 0); diff --git a/components/lib/datatable/FooterCell.vue b/components/lib/datatable/FooterCell.vue index 9d64c7c5d..89efacdd9 100644 --- a/components/lib/datatable/FooterCell.vue +++ b/components/lib/datatable/FooterCell.vue @@ -1,5 +1,5 @@