Custom pagination

Custom pagination

nickosnickos Posts: 2Questions: 1Answers: 0

Hi, i want to know how can I implement a custom pagination. I am retrieving data from db, populate them to datatable and set pagination per 10 rows. So far so good.
What if i would like to do pagination based on the first column (id). The first column is type numeric from 0000 to 9999 (not continuous) and unique. I would like to make pagination when the id is changing (example 0000-0010 , 0011-0019 ...).
The problem is that the numbers are not continuous...
Thanks in advance......

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @nickos ,

    That's not possible, I'm afraid. You could do some clever stuff perhaps with the draw and set page.len(), but the problems will be

    1. the number of rows before this start of this page, they'll need to be a multiple of the page length too,
    2. when you reorder the table, or do a search, you'll need to do something there too

    So, sorry, I think that's a no-goer.

    Cheers,

    Colin

  • nickosnickos Posts: 2Questions: 1Answers: 0

    Thank you colin. I will try your solution and post again.

This discussion has been closed.