Ants24 / angular2-datatable-pagination

MIT License
6 stars 7 forks source link

server example - _.slice start end #2

Open MichaelChambers opened 7 years ago

MichaelChambers commented 7 years ago

In server.component.ts loadData, you have this.data = _.slice(this.data, this.activePage, this.activePage + this.rowsOnPage);

For me, that didn't work correctlly as the display was only increasing one row at a time. I have:

    const start :number = (this.activePage - 1) * this.rowsOnPage,
        end :number = _.min([start + this.rowsOnPage, this.data.length]);
    this.data = _.slice(this.data, start, end);