pull/256/head
cagataycivici 2020-03-16 19:34:32 +03:00
parent 1c178dcc8b
commit b76a9c502f
1 changed files with 22 additions and 16 deletions

View File

@ -100,11 +100,10 @@ export default {
this.virtualScrollCallback();
this.virtualScrollCallback = null;
}
},
watch: {
scrollHeight() {
this.setScrollHeight();
},
watch: {
totalRecords(newValue) {
if (this.virtualScroll) {
this.$refs.virtualScroller.style.height = newValue * this.virtualRowHeight + 'px';
@ -162,6 +161,12 @@ export default {
},
setScrollHeight() {
if (this.scrollHeight) {
let frozenView = this.$el.previousElementSibling;
if (frozenView) {
let frozenScrollBody = DomHandler.findSingle(frozenView, '.p-datatable-scrollable-body');
this.$refs.scrollBody.style.maxHeight = frozenScrollBody.style.maxHeight;
}
else {
if(this.scrollHeight.indexOf('%') !== -1) {
let datatableContainer = this.findDataTableContainer(this.$el);
this.$refs.scrollBody.style.visibility = 'hidden';
@ -179,6 +184,7 @@ export default {
this.$refs.scrollBody.style.maxHeight = this.scrollHeight;
}
}
}
},
hasVerticalOverflow() {
return DomHandler.getOuterHeight(this.$refs.scrollTable) > DomHandler.getOuterHeight(this.$refs.scrollBody);