【发布时间】:2019-01-18 10:14:19
【问题描述】:
我需要将我的p-table 的选定页面作为最后一页。
我能够得到我的表格对象:
@ViewChild('myTable') myTable: DataTable;
ngOnInit() {
this.subService.subsUpdated.subscribe(result => {
this.fetchSubcontracts();
});
this.appForm.subAdded.subscribe(result => {
this.added = 4;
this.fetchSubs();
});
}
我尝试将p-table 上的[first] 和[paginatorPosition] 属性绑定到一个属性,但没有成功。
<p-table #myTable
[value]="subs"
sortMode="multiple"
selectionMode="single"
(onRowSelect)="onRowSelect($event)"
(onRowUnselect)="onRowUnselect($event)"
[(selection)]="selectedSub"
[columns]="columns"
dataKey="id"
[paginator]="subs.length > 0"
[rows]="5"
[first]="added"
>
【问题讨论】:
-
你能创建一个 StackBlitz 或分享更多代码吗?
-
@Antikhippe 我至少在我的表格配置信息中添加了 html 以及我尝试设置页面的位置。我也不知道如何获取表格的最后一页。
-
你现在有多少元素?
-
我下面的回答解决了你的问题吗?任何反馈将不胜感激
标签: angular primeng primeng-turbotable