How to get data from specific page

How to get data from specific page

d88d88 Posts: 2Questions: 1Answers: 0

Hi guys,

I have a DataTable set up with a pagination and I'm trying to loop through the pages in order to fetch the data that is displayed in each page individually, but I've been unable to do so.
Any help would be appreciate it.
Regards.

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Pagination should be handled automatically by DataTables, if you look at the most basic example.
    https://datatables.net/examples/basic_init/zero_configuration.html

    In that context, your question isn't very clear.

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin

    @d88 - Can you post a link to a test page showing the issue please.

    Allan

  • d88d88 Posts: 2Questions: 1Answers: 0

    Hi tangerine, let me explain a little further. I have a big DataTable with pagination in order to split the information and not overload it in one page. Now, i need to be able to export that information into pdf, excel, etc. Although, I know there is a plugin to do that kind of operation, I'm using my own couse I need to do a lot of customization and reuse it for other datatables. Now, my initial idea was to loop through the pages in the pagination in order to individually get each data shown in every page and add it to my export function. But I can't find a way to do something like, and this is not correctly written of course just to explain my point, table->getData->inPage(i).
    Thanks for your response

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin
    edited August 2017

    rows().data() will give you the data from the table. You could also use buttons.exportData() which is the method Buttons uses to get the export data.

    Allan

This discussion has been closed.