Track exported rows

Track exported rows

anujeetanujeet Posts: 39Questions: 15Answers: 0

Hi.

I want to mark the exported rows in my database. Is there a way, that I can track which rows are exported?
Or maybe run a server side request when the data is being exported?

Thanks

Answers

  • rf1234rf1234 Posts: 2,934Questions: 87Answers: 415

    What do you mean by "rows exported"? Do you mean the Excel, CSV or PDF export?
    If that is what you mean: You know which rows are being exported when the user clicks the export button. It is either all rows of the table or the rows filtered etc. - depending on what your settings are. On export button click you can send all of their IDs to the server in an ajax call and update your database accordingly.

    You can use rows().ids() to get the ids. Here is a thread on it:
    https://datatables.net/forums/discussion/57075

    And the docs:
    https://datatables.net/reference/api/rows().ids()

This discussion has been closed.