如何在详细信息网格中设置无限滚动/分页。我使用服务器端模型作为主模型,并希望使用无限模型作为细节。如何使用无限滚动行数据设置详细信息网格detailCellRendererParams
定义detailGridOptions无限行模型类型及其属性:
detailGridOptions: {
...
rowModelType: 'infinite',
// enable pagination
pagination: true,
// fetch 15 rows per at a time
cacheBlockSize: 15,
// display 10 lines per page
paginationPageSize: 10,
// how many rows to seek ahead when unknown data size.
cacheOverflowSize: 2,
// how many concurrent data requests are allowed.
// default is 2, so server is only ever hit with 2 concurrent requests.
maxConcurrentDatasourceRequests: 2,
// how many rows to initially allow scrolling to in the grid.
infiniteInitialRowCount: 1,
// how many pages to hold in the cache.
maxBlocksInCache: 2
}
Run Code Online (Sandbox Code Playgroud)
介绍infiniteDatasource了检索详细部分数据的方式:
getDetailRowData: (params) => {
//Get grid api regarding current row
var detailGrid = gridOptions.api.getDetailGridInfo(params.node.id);
//Simulation of server
var server = new FakeServer(params.data.callRecords);
//Preparation of data
var datasource = new infiniteDatasource(server, params);
detailGrid.api.setDatasource(datasource);
}
Run Code Online (Sandbox Code Playgroud)
请注意,关于文档:
如果您是企业用户,您应该考虑使用服务器端行模型而不是无限行模型。它提供了相同的功能以及更多的特性。
Server端行模型的设置应该与Infinite one类似。
| 归档时间: |
|
| 查看次数: |
7698 次 |
| 最近记录: |