【问题标题】:How to use paginator separate and show page info in PrimeNG Table?如何在 PrimeNG Table 中单独使用分页器并显示页面信息?
【发布时间】:2019-10-25 14:41:21
【问题描述】:

在我的paginator 中显示自定义页面信息,例如Show {{startItem}} - {{endItem}} of {{totalRecords}} 我发现我需要在我的 PrimeNG 表中使用 currentPageReportTemplate 和一个单独的 paginator。问题是我无法让它与我的桌子通信。

我的代码:

<p-table #dt [columns]="cols" [value]="ciConfig" [resizableColumns]="true" columnResizeMode="expand"
    [scrollable]="true" [(selection)]="mySelection" selectionMode="multiple" exportFilename="MessagesConfig"
    [showCurrentPageReport]="true">
  ...
</p-table>
<p-paginator [rows]="10" [rowsPerPageOptions]="[5,10,20,50,100]"
 currentPageReportTemplate="Show {{startItem}} - {{endItem}} of {{totalRecords}}"
 (onPageChange)="paginate($event)>
</p-paginator>

可能我需要添加分页器的dropdownAppendTo 属性,但仍然找不到使其工作的方法。有什么想法吗?

【问题讨论】:

  • 我认为你错过了 [paginator]="false" 属性
  • 改了,还是没有。 @SoumyaGangamwar

标签: angular primeng


【解决方案1】:

添加:

[showCurrentPageReport] = "true" currentPageReportTemplate = "我自己的模板"

它有效。

https://www.primefaces.org/primeng/#/paginator

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 1970-01-01
    • 2023-03-06
    • 2019-12-25
    相关资源
    最近更新 更多