angular - 如何在primeng表的paginator-bottom手动设置当前页码?
问题描述
我在 Angular 中使用 PrimeNg 表。我正在尝试手动更改当前页面。
我的问题是我的问题的屏幕截图
我将当前页面设置为 10 ( this.onFetchDestinationsHandler(10);
)。数据表是完美的工作(见截图它显示数据为 218 的 91 到 100)。但是分页器显示 1 (paginator-highlight-number 是 1) 但它应该是 10
我该如何手动设置?请有人帮助我。
.html
<p-table
[value]="destinations"
[lazy]="true"
(onLazyLoad)="lazyLoadHandler($event)"
[paginator]="true"
[rowHover]="true"
currentPageReportTemplate=" {{first}} to {{last}} of {{totalRecords}}"
[showCurrentPageReport]="true"
[rows]="perPage"
[totalRecords]="totalRecords"
[loading]="loading"
[(selection)]="selectedItems"
[scrollable]="true"
>
//table -header
//table-body
</p-table>
.ts 文件
lazyLoadHandler(event: LazyLoadEvent) {
const currentPage = event.first / event.rows + 1;
this.onFetchDestinationsHandler(10); // It means current page is 10,And It works table shows data as 91 to 100 of 218. But in bottom paginator page number is in number 1
//(paginator-highlight-number is 1 .It should be 10 )
}
解决方案
推荐阅读
- java - 为什么不收集我的内容解析器的所有歌曲/文件?
- c - 如何读取多行的字符串并打印偶数位字符和奇数位字符,每个stri中用空格分隔
- asp.net-mvc - 如何将 IStringLocalizer 注入 IApplicationModelConvention?
- mongodb - MongoDb 文本搜索返回空结果
- c# - DelegatingHandler 在返回 Task 时挂起
- python - 对每一行中的单词进行排序
- neo4j - 无法通过浏览器连接到 neo4j,neo4j 浏览器中的螺栓端口已更改
- android - 来自 Qt Android C++ Firebase 的哄骗日志信息(通知不起作用)
- amazon-web-services - 从 AWS CloudFront 中删除 Cache-Control 标头?
- c++ - 打印此矩阵的 if 语句是什么