Fixed #462 - Scrollable Table alignment improvement

pull/642/head
Cagatay Civici 2020-09-08 14:48:52 +03:00
parent d8488e9dee
commit 67720d1750
1 changed files with 3 additions and 23 deletions

View File

@ -104,10 +104,6 @@ export default {
}
},
updated() {
if (!this.frozen) {
this.alignScrollBar();
}
if (this.virtualScrollCallback) {
this.virtualScrollCallback();
this.virtualScrollCallback = null;
@ -169,28 +165,12 @@ export default {
}
}
},
hasVerticalOverflow() {
return DomHandler.getOuterHeight(this.$refs.scrollTable) > DomHandler.getOuterHeight(this.$refs.scrollBody);
},
alignScrollBar() {
let scrollBarWidth = this.hasVerticalOverflow() ? DomHandler.calculateScrollbarWidth() : 0;
let scrollBarWidth = DomHandler.calculateScrollbarWidth();
this.$refs.scrollHeaderBox.style.marginRight = scrollBarWidth + 'px';
this.$refs.scrollHeaderBox.style.paddingRight = scrollBarWidth + 'px';
if (this.$refs.scrollFooterBox) {
this.$refs.scrollFooterBox.style.marginRight = scrollBarWidth + 'px';
}
},
findDataTableContainer(element) {
if (element) {
let el = element;
while (el && !DomHandler.hasClass(el, 'p-datatable')) {
el = el.parentElement;
}
return el;
}
else {
return null;
this.$refs.scrollFooterBox.style.paddingRight = scrollBarWidth + 'px';
}
},
shouldRenderCol(column) {