Fixed #981 - Disable virtual scroll table
parent
c20bd23e14
commit
1c1b495a9a
|
@ -55,9 +55,6 @@ interface DataTableProps {
|
||||||
scrollHeight?: string;
|
scrollHeight?: string;
|
||||||
frozenValue?: any[];
|
frozenValue?: any[];
|
||||||
frozenWidth?: string;
|
frozenWidth?: string;
|
||||||
virtualScroll?: boolean;
|
|
||||||
virtualRowHeight?: string;
|
|
||||||
virtualScrollDelay?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class DataTable {
|
declare class DataTable {
|
||||||
|
|
|
@ -293,18 +293,6 @@ export default {
|
||||||
frozenValue: {
|
frozenValue: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null
|
default: null
|
||||||
},
|
|
||||||
virtualScroll: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
virtualRowHeight: {
|
|
||||||
type: Number,
|
|
||||||
default: 28
|
|
||||||
},
|
|
||||||
virtualScrollDelay: {
|
|
||||||
type: Number,
|
|
||||||
default: 150
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -338,7 +326,6 @@ export default {
|
||||||
columnWidthsState: null,
|
columnWidthsState: null,
|
||||||
tableWidthState: null,
|
tableWidthState: null,
|
||||||
columnWidthsRestored: false,
|
columnWidthsRestored: false,
|
||||||
virtualScrollTimer: null,
|
|
||||||
watch: {
|
watch: {
|
||||||
first(newValue) {
|
first(newValue) {
|
||||||
this.d_first = newValue;
|
this.d_first = newValue;
|
||||||
|
@ -1520,18 +1507,6 @@ export default {
|
||||||
this.$emit('update:editingRows', _editingRows);
|
this.$emit('update:editingRows', _editingRows);
|
||||||
this.$emit('row-edit-cancel', event);
|
this.$emit('row-edit-cancel', event);
|
||||||
},
|
},
|
||||||
onVirtualScroll(event) {
|
|
||||||
if(this.virtualScrollTimer) {
|
|
||||||
clearTimeout(this.virtualScrollTimer);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.virtualScrollTimer = setTimeout(() => {
|
|
||||||
this.$emit('virtual-scroll', {
|
|
||||||
first: (event.page - 1) * this.rows,
|
|
||||||
rows: this.rows * 2
|
|
||||||
});
|
|
||||||
}, this.virtualScrollDelay);
|
|
||||||
},
|
|
||||||
createLazyLoadEvent(event) {
|
createLazyLoadEvent(event) {
|
||||||
let filterMatchModes;
|
let filterMatchModes;
|
||||||
if (this.hasFilters()) {
|
if (this.hasFilters()) {
|
||||||
|
@ -1595,7 +1570,6 @@ export default {
|
||||||
'p-datatable-scrollable-vertical': this.scrollDirection === 'vertical',
|
'p-datatable-scrollable-vertical': this.scrollDirection === 'vertical',
|
||||||
'p-datatable-scrollable-horizontal': this.scrollDirection === 'horizontal',
|
'p-datatable-scrollable-horizontal': this.scrollDirection === 'horizontal',
|
||||||
'p-datatable-scrollable-both': this.scrollDirection === 'both',
|
'p-datatable-scrollable-both': this.scrollDirection === 'both',
|
||||||
'p-datatable-virtual-scrollable': this.virtualScroll,
|
|
||||||
'p-datatable-flex-scrollable': (this.scrollable && this.scrollHeight === 'flex')
|
'p-datatable-flex-scrollable': (this.scrollable && this.scrollHeight === 'flex')
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue