简体   繁体   English

Ag-grid 的服务器端模型和分页

[英]Server-side model and pagination for Ag-grid

When using the server-side model for Ag-grid, how does the grid know the number of pages (ie how does it display Page 1 of X)...coz we only fetch like eg 100 records at once even if there are like 500 possible records ...(so how does the grid know that X here is 5)当使用 Ag-grid 的服务器端模型时,网格如何知道页数(即它如何显示 X 的第 1 页)...因为我们只能一次获取例如 100 条记录,即使有500 条可能的记录……(所以网格怎么知道这里的 X 是 5)

Is there some specific attribute to be set (for X) when calling the AGGrid component ?调用 AGGrid 组件时是否有一些特定的属性要设置(对于 X)?

You could either use something like below Documentation您可以使用类似下面的文档

在此处输入图片说明

Or you can implement infinite scrolling Documentation或者你可以实现无限滚动文档

There is another example implemented that is explained at SO还有另一个实现的示例,在 SO 中进行了解释

Ag grid Server side pagination Ag 网格服务器端分页

https://github.com/renilbabu03/agGridExample https://github.com/renilbabu03/agGridExample

The grid property paginationPageSize is what determines how many rows will show per page.网格属性paginationPageSize决定了每页显示多少行。

By default paginationPageSize is set to 100.默认情况下, paginationPageSize设置为 100。

For example in the following example: https://plnkr.co/edit/3VUNVvSNucbnsbJe例如在以下示例中: https : //plnkr.co/edit/3VUNVvSNucbnsbJe

There are 8000 rows in the Server, the Grid is fetching 500 rows at a time and there are 200 rows in each page.服务器中有 8000 行,网格一次获取 500 行,每页有 200 行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM