Can I use variable length pagination with file export functionality?

Can I use variable length pagination with file export functionality?

Thomas_2019Thomas_2019 Posts: 2Questions: 1Answers: 0

Hi,

I am trying to use the pagination with the file export functionality, but I can't get it to work, the way I wish.

Here is my set up function.

$('#dtDisplay').DataTable(
    {
        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print'],
        "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
    });

As it is, the download functionality works, but the pagination is set to 10 records, and I do not get the dropdown that allows the user to change the number of records displayed per page.

If I remove

        dom: 'Bfrtip',
        buttons: ['copy', 'csv', 'excel', 'pdf', 'print'],

then I get the download, but of course lose the ability to download the data.

How can I get both?

That is; I would like to have both the ability to allow the user to change the number of records per page and be able to download the datatable.

Regards, Tom

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,255Questions: 26Answers: 4,761
    Answer ✓

    Please see this FAQ for the answer :smile:

    Kevin

  • Thomas_2019Thomas_2019 Posts: 2Questions: 1Answers: 0

    Thanks Kevin! You saved me a ton of time and grief.

This discussion has been closed.