0
我正尝试使用angular2-data-table模块(https://www.gitbook.com/book/swimlane/angular2-data-table/details)创建我的表格。分页和排序应该通过服务器来处理。要加载并使用以下方法从后端I'm设置我的数据:angular2-data-table服务器分页不起作用
this.loadData('sortColumn', 'ASC', this.currentPage, this.options.limit)
.subscribe(ratings => {
this.rows = [];
this.rows.push(...ratings.ratings);
//For testing
this.maxRows = 10;
this.options.count = 10;
if (this.maxRows < this.options.limit) {
this.endRow = this.maxRows;
}
}, error => this.errorMessage = <any>error);}
this.rows是可变I'm绑定到数据表模板:
<datatable class="rating_table" [rows]='rows' [options]='options' (onRowClick)='onRowClick($event)' (onPageChange)='onPage($event)'>
我问题是当我加载第一页的数据绑定工作,并在表中我的评级显示,但是当我加载第二页this.rows设置为ratings.ratings对象,但表不刷新旧的收视率仍然可见。有人能帮助我,我不知道为什么桌子不清爽。