"static" Pagination

"static" Pagination

d1rtyd1rty Posts: 4Questions: 2Answers: 0
edited May 2018 in Free community support

Hi everyone,

my DataTables data is coming from the Perl-script itself (which generates the html page), and it does pagination by default (with ?page=xx parameter) to reduce database load. The data is already in the DOM.

How can I initialize DataTables with:
- giving it the amount of total records
- adding the page parameter to the pagination so that click the page-link just loads the same page with another page parameter?

EDIT: I found https://datatables.net/examples/server_side/custom_vars.html, but this is not useable because the data is already in the DOM.

I guess that the search feature (over all data) will break at this point, but I don't care about that really much.

Many thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Hi,

    Have a look at this blog post which describes a method of deep linking into DataTables.

    Allan

  • d1rtyd1rty Posts: 4Questions: 2Answers: 0

    Hi,

    thanks for the answer. The missing piece seems now to be how I can tell DataTables that there are thousands of pages available to properly display the pagination. Remeber, the current DOM only holds a short amount of all data.

    I did not find out how I can do that with the deep link functionality =/

    Thanks

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    deferLoading can be used for that. See this example.

    Allan

This discussion has been closed.