Hi Aman,
Thanks for contacting Syncfusion support,
We have achieved your responsive Grid with pageSize update dynamically while resize the window basis. We would like to inform you that by default the row height for Grid will be 37(including border). To update the total records count in Grid, based on the browser window size, you need to provide the calculations based on your requirement and browser window. The final value need to be assigned to “pageSize” property of Grid. This will update the Grid’s total records count for the particular page. The calculation is completely based on your requirement, and the final value you set for the “pageSize” will only affect the Grid.
[index.js]
componentDidMount() {
window.addEventListener('resize', this.onresize.bind(this));
}
onresize(e) {
var grid = this.gridInstance;
var rowHeight = grid.getRowHeight(); //height of the each row
var gridHeight = Number(window.innerHeight - 120); //grid height
var pageSize = Number(grid.pageSettings.pageSize) + 10; //initial page size
var pageResize = (gridHeight - (pageSize * rowHeight)) / rowHeight;
grid.pageSettings.pageSize = pageSize + Math.round(pageResize);
}
|
Please get back to us, if you need further assistance.
Regards,
Seeni Sakthi Kumar S