On a grid with virtualization enabled, if the grid height is changed, then the grid doesn't display properly.
Here is a sandbox example:
https://codesandbox.io/s/syncfusion-virtual-grid-change-height-8q79c?file=/src/components/Grid.vue
If you scroll to the bottom of the grid, and then scroll back to the top, you'll see a big margin at the top. Below is a screenshot. The use-case for this scenario is to automatically resize the grid to fit the screen.
Hi, any update on this issue? It repros on 19.3, as shown in attached zip. Thanks.
|
App.vue
<template>
<div>
<ejs-grid
ref="grid"
:columns="columns"
:dataSource="rows"
:enableVirtualization="true"
:allowResizing="true"
:height="height"
:pageSettings="pageSettings"
/>
</div>
</template>
<script>
import Vue from "vue";
import { GridPlugin, Resize, VirtualScroll } from "@syncfusion/ej2-vue-grids";
Vue.use(GridPlugin);
export default {
name: "Grid",
data() {
return {
height: 200,
pageSettings: { pageSize: 30 }, set the pageSize as per the height
rows: [...Array(55550).keys()].map((index) => ({
name: "John Doe",
location: "London",
purchase: 5,
})),
};
},
computed: {
columns() {
return [
{
field: "name",
headerText: "Name",
},
{
field: "location",
headerText: "Location",
},
{
field: "purchase",
headerText: "Purchase",
},
];
},
},
provide: {
grid: [Resize, VirtualScroll],
},
mounted() {
setTimeout(() => {
var grid = document.getElementsByClassName("e-grid")[0].ej2_instances[0];
grid.height = 500;
}, 1000);
},
};
</script> |
Thank you Ajith. That appears to resolve that issue. However, the performance with virtualization seems to have degraded. I have to try to put together a minimal reproducible example, and sent the sample code to