Skip to content

Commit

Permalink
Fixed #2756 - Add getVirtualScrollerRef method to DataTable to access…
Browse files Browse the repository at this point in the history
… virtualScroller's reference
  • Loading branch information
mertsincan committed Jul 4, 2022
1 parent cd8b59b commit 6898e45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/datatable/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</template>
</DTPaginator>
<div class="p-datatable-wrapper" :style="{ maxHeight: virtualScrollerDisabled ? scrollHeight : '' }">
<DTVirtualScroller v-bind="virtualScrollerOptions" :items="processedData" :columns="columns" :style="{ height: scrollHeight }" :disabled="virtualScrollerDisabled" loaderDisabled :showSpacer="false">
<DTVirtualScroller ref="virtualScroller" v-bind="virtualScrollerOptions" :items="processedData" :columns="columns" :style="{ height: scrollHeight }" :disabled="virtualScrollerDisabled" loaderDisabled :showSpacer="false">
<template #content="slotProps">
<table ref="table" role="table" :class="[tableClass, 'p-datatable-table']" :style="[tableStyle, slotProps.spacerStyle]">
<DTTableHeader :columnGroup="headerColumnGroup" :columns="slotProps.columns" :rowGroupMode="rowGroupMode"
Expand Down Expand Up @@ -1780,6 +1780,9 @@ export default {
}
return _data;
},
getVirtualScrollerRef() {
return this.$refs.virtualScroller;
}
},
computed: {
Expand Down

0 comments on commit 6898e45

Please sign in to comment.