Fixed #234
parent
1c178dcc8b
commit
b76a9c502f
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue