当从API获取数据时,我想更新totalRecords of primeng表。
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个”.Even,但我将其设置为explicitly =‘dataTotalRecord’,无法完成。
请帮我解决这个问题。
发布于 2022-10-26 13:52:10
在[lazy]="true"元素上设置<p-table>属性。
https://stackoverflow.com/questions/74003385
复制相似问题