Angular 在ag网格社区v22的infinitePageRowModel中重置缓存
在ag网格中使用“无限”行模型。我已经实现了分页Angular 在ag网格社区v22的infinitePageRowModel中重置缓存,angular,typescript,grid,ag-grid-angular,Angular,Typescript,Grid,Ag Grid Angular,在ag网格中使用“无限”行模型。我已经实现了分页 <select [(ngModel)]="pageSizeSelected" (change)="onPaginationChanged($event)"> <option value="10">10</option> <option value="20">20</option&
<select [(ngModel)]="pageSizeSelected" (change)="onPaginationChanged($event)">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
<ag-grid-angular
#myGrid
class="ag-theme-balham"
[columnDefs]="columnDefs"
[gridOptions]="gridOptions"
[cacheOverflowSize]="cacheOverflowSize"
[maxConcurrentDatasourceRequests]="maxConcurrentDatasourceRequests"
[infiniteInitialRowCount]="infiniteInitialRowCount"
[pagination]=true
(gridReady)="onGridReady($event)">
</ag-grid-angular>
在设置了两个Grid选项之后,我可以看到,在Quick Watch中,它们已被设置,但inifitePageRowModel.cacheParams仍然选择了previous,即10。那么**如何重置缓存参数,以便相应地重置起始行-0和结束行-15**
但我如何才能做到这一点。我试过了-
purgeInfiniteCache-它清除整个数据并进行新调用,但这并没有按预期设置我的IGetRowParams
refreshInfiniteCache-它在内部调用RefreshCache而不是resetCache
请问,是否有人知道如何在infinitePageRowModel中重置CAHCE。请参阅
我已经通过下面的链接,它很好地解释了,但这个解决方案不适合我。因为InfinitePageRowModel是GridApi类的私有类。任何人都知道如何重置缓存。
onPaginationChanged(event){
this.gridOption.cacheBlockSize = pageSizeSelected;
this.gridOption.paginationSetPageSize(pageSizeSelected);
onGridPageSizeChanged(size: number): void {
this.gridOptions.cacheBlockSize = size;
//// this is a way to use private fields in typescript
const api: any = this.gridOptions.api;
api.infinitePageRowModel.resetCache();
this.gridOptions.paginationPageSize = size;
}