【发布时间】:2022-11-11 07:05:48
【问题描述】:
我想更新 totalRecords 的普门从 API 获取数据时的表
this.customerService.getData().subscribe(data=>
this.dataApi = data.users;
this.dataTotalRecords = data.total;
});
<p-table [value]="dataApi" [totalRecords]='dataTotalRecords' [rows]="10"
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries"></p-table>
就我而言,它显示“显示 30 个条目中的 1 到 10 个”。 dataApi.length = 30 并且 dataTotalRecords 为 100。所以,我想显示为“显示 100 个条目中的 1 到 10 个”。尽管如此,我将其明确设置为 [totalRecords]='dataTotalRecords' ,但无法做到。
请帮我解决这个问题。
【问题讨论】:
标签: angular primeng-table