Redraw table without changing the pagination count

Redraw table without changing the pagination count

AdarshaAdarsha Posts: 2Questions: 1Answers: 0

Hi,
I am getting 300 records from API and rendering in table.
On first load Pagination is 1 to 30 (10 records per page).
When i am in 30th page, if i click NEXT button I am calling API and again getting 300 records from server.
Problem is when rendering another set of 300 records pagination is resetting to 1 - 30.
I need to show 31 to 60.

Am i wrong somewhere else when rendering...?

Please check with attached file.

Thanks.

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    It looks like you're rewriting serverSide, it would be worth looking at that to see if it does what you want. For server side processing, enable serverSide. The protocol is discussed here. Also see examples here.

    Cheers,

    Colin

  • AdarshaAdarsha Posts: 2Questions: 1Answers: 0

    Hi @colin
    I am not enabled server side rendering.
    On NEXT button click again i am calling API and getting data.
    Before drawing a table I am calling table.clear().draw() method.

    If I call that method is it removes previously defined all initial settings...?

    Thanks.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    table.clear().draw() would just clear the data, not the settings. I'm not clear what the use case is here, since as I said, functionally is looks like you're rewriting the behaviour of serverside,

    Colin

This discussion has been closed.