Ag-grid批量调用数据加载

Ag-grid batch calls for data loading

我正在使用 ag-grid 进行显示。不想一下子把完整的数据带过来。 例如当用户在第 10 页时,我想带来第 11-20 页数据 我该如何实施?

您可以切换到 Ag-grid infinite scrolling row model

有关 row models, visit documentation: https://www.ag-grid.com/javascript-grid-row-models/

的更多详细信息

i want to bring 11-20th page data when user on 10th page

我希望你的意思是当用户滚动查看第 10 条记录时加载第 11-20 条记录。
为了那个原因, 相应地设置参数 maxBlocksInCachecacheBlockSize = 10(使缓存块大小为 10)、infiniteInitialRowCount


更新

根据ag-grid documentation

In v9.0 ag-Grid pagination changed from server side pagination to client side pagination. Server side pagination was then removed in v10.1.

If you were doing server side pagination, we recommend moving to pagination with infinite scrolling as a way of migration to the new mechanism.

If you were slicing manually the data in your Datasource to mimic pagination done in the browser only, we recommend that you use the default In Memory Row Model and set the row data as normal and then set grid property pagination=true.