question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server pagination not working

See original GitHub issue

Pagination and Sorting should be handled through the server. To load my data from the backend I´m using the following method:

this.loadData('sortColumn', 'ASC', this.currentPage, this.options.limit)
        .subscribe(ratings => {
        this.rows = [];
        this.rows.push(...ratings.ratings);
        this.endRow = this.options.limit * (this.options.offset + 1);
        this.maxRows = ratings.recordsTotal;
        if (this.maxRows < this.options.limit) {
          this.endRow = this.maxRows;
        } else if (this.maxRows < this.endRow) {
          this.endRow = this.maxRows;
        }
        this.options.count = this.maxRows;
  }, error => this.errorMessage = <any>error);}

this.rows is the variable I´m binding to the data-table-template:

<datatable class="rating_table" [rows]='rows' [options]='options' (onRowClick)='onRowClick($event)' (onPageChange)='onPage($event)'>

My problem is when I´m loading the first page the data binding ( this.rows.push(…ratings.ratings)) works and in the table my ratings are shown, but when I´m loading the second page the new ratings are saved into the this.rows object but the table is not refreshing the ratings from page one are still visible.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:53 (14 by maintainers)

github_iconTop GitHub Comments

16reactions
PatrickHuettercommented, Feb 3, 2017

Is there any progress on this? I think this is a critical bug.

5reactions
amcdnlcommented, Mar 9, 2017

@stefmabo - can you PR this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datatable Pagination not working properly on server side
I've generated my table in server side and I was able to get the data from my DB and it works perfect but...
Read more >
jquery datatable server-side pagination not working
I'm trying to implement the jquery datatables on a php project using the server-side processing, but the pagination is not working and I ......
Read more >
[Explore] Server pagination is not working #15478 - GitHub
Server side pagination has no effect. The server side pagination option for the table chart correctly retrieves the first page of results ...
Read more >
Table new page data not loading on click of next button in ...
I can see pagination is showing correct results count and pagination details. But clicking on next button does not load new records in...
Read more >
bootstrap-table with server-side pagination not working correctly
Your server code is missing something to handle page number, rows per-page, order etc. Server should only return the rows for that page....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found