Hello,
thank you for your answer.
I have one more question about sizes.
In my grid I am using row virtualization. As in documentation (https://ej2.syncfusion.com/16.1.37/angular/documentation/grid/virtualization.html#row-virtualization) I am using property enableVirtualization = true. I am counting height and pageSize on window resize. As mentioned in limiations for virtualization (https://ej2.syncfusion.com/16.1.37/angular/documentation/grid/virtualization.html#limitations-for-virtualization), my pageSize setting is twi times as big as I can see records in my grid by setted height.
When data is loaded for the first time, I am getting correct results as it should be. When I am clicking on scroll bar, the bar is moving, but I am not getting any new data (only data old data is displayed and displayed again).
When I am clicking on bar and moving it with mouse, the same data is also displayed and displayed again. When I stopped, I am getting new data from my WebAPI (I get new correct object, the new data is displayed), but I am getting another problem - on row click event I am getting no data about row.
Also - when I resize my grid - I am getting new object with data from my WebAPI, but the grid shows nothing...
I am adding video, where you can see how this grid is working with my mentioned problems.
My .html file:
<ejs-grid [enableVirtualization]=true [pageSettings]="pageSettings" [height]="height" rowHeight="27"></ejs-grid>
My .ts file:
public height;
public pageSettings: PageSettingsModel;
constructor(private resizeService) {
this.resizeService.onResize.subscribe(sizes => { this.Resize(sizes) })
}
private Resize(sizes) {
// Set grid height
this.height = sizes.height;
// Set pageSize (grid height / row height * 2) - (from limitations: The page size provided must be two times larger than the number of visible rows in the grid. If the page size is failed to meet this condition then the size will be determined by grid.)
this.pageSettings = { pageSize: Math.ceil(this.height / 27 * 2) }
}
Maybe you know what am I doing wrong?
Attachment:
VirtualGrid_56b7cb7f.zip