Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Copy, excel, and print buttons export all records rather than only the ones visible on the screen

$
0
0

In my scenario, I have some dropdowns that dynamically filter the visible records on the screen. That much is correct.

For example: g.change(function() { filterTable(); }); which triggers the following function.

function filterTable() {
    var t = $(".display").DataTable();
    t.destroy();
    $(".display").DataTable(config);

    // lots of more code...

    if (g.val().length > 0) {
        t.column(9).search(g.val());
    }


    t.draw();
}

However, when any of my three buttons are clicked, all records are exported rather than the filtered ones.

How do I need to configure my buttons so that they export only the visible records?

This is what I have so far. I figured I'd have to extend them but I can't find anything in the documentation to tell me how to extend the buttons.

buttons: ['copy', 'excelHtml5', 'print']

Viewing all articles
Browse latest Browse all 2364

Trending Articles