ggmod / angular-2-data-table

An Angular 2 data table, with pagination, sorting, expandable rows, row selection etc.
69 stars 136 forks source link

[limit]="5" is not working when it first load. #54

Open San13 opened 6 years ago

San13 commented 6 years ago

I use limit by default 5. But it keeping showing me all records at first load. However, if i manually key in limit value, it works. Please suggest.

okpablo commented 6 years ago

Having exactly the same issue. Did you solved it?

esraagalal commented 6 years ago

same here, any update in this issue ?

San13 commented 6 years ago

Change your limit inside initializeTable as well.

public initializeTable(inspections: Inspection[]) { this.tableResource = new DataTableResource(inspections); this.tableResource.query({ index: 0, offset: 0, limit: 20, sortBy: 'inspectedDate', sortAsc: true }) .then(items => this.items = items); this.tableResource.count() .then(count => this.itemCount = count); }