Dynamic records per page

Dynamic records per page

dieegovdieegov Posts: 2Questions: 1Answers: 0

Hello, how i do that?
In my case, i have all records in my db with line and page.

Records e.g

id  |  pag  | desc
------------------------
 1  |    1    | Foo
 2  |    2    | Bar
 3  |    1    | Foo Bar
 4  |    1    | Bar Foo 
------------------------

Now i need set records to correct page (eg: Record #1 to page 1, Record #2 to page 2, Record #3 to page 1).

Tips?

Answers

  • ignignoktignignokt Posts: 146Questions: 4Answers: 39
    edited March 2015

    Allan would have a better idea if this is doable in any sort of easy way using the datatables pagination, but I would doubt it would easy if possible at all.

    This is what I would suggest is to instead which seems much easier and wouldn't make datatables perform in a way it isn't meant to be used. Make a single table showing all of the page 1 records on load. Have another query on page load that will get all the unique pages from your database, and build a row of buttons similar to the pagination look if that is what you want. Then when they click on your "2" button, you reload the table with only page 2 data.

  • dieegovdieegov Posts: 2Questions: 1Answers: 0

    I think in this possibility, thanks for reply.

This discussion has been closed.