Search code examples
javascriptjquerydownloaddatatablestabletools

Datatables TableTools download only downloading part of table


I'm using the Datatables plugin TableTools to provide the ability of the user to download the table contents. The tables are in memory in Javascript (no server side pagination). But when I try to download the table, I'm not getting the entire contents -- only the first page plus a row or so.

I'm configuring TableTools as follows:

        tableToolsProps = {
            "aButtons"  : [{
                "sExtends": "copy",
                "mColumns": "all"
            },
            {   
                "sExtends": "csv",
                "mColumns": "all"
            },
            {
                "sExtends": "xls",
                "mColumns": "all"
            }],
            "sSwfPath"  : "media/DataTables-1.10.0/extensions/TableTools/swf/copy_csv_xls.swf"
       ....

        oTable.dataTable({
            "bDestroy" : true,
            "bRetrieve" : true,
            "bJQueryUI" : true,
            "bProcessing" : true,
            "sPaginationType" : "full_numbers",
            "sAjaxSource" : javaApiUrl + "rest/"+ urlSuffix,
            "tableTools": tableToolsProps,
        ....

You can see a running example of the code in the table at the bottom of this page: http://www.gtexportal.org/home/gene/ACTN3

Any ideas?


Solution

  • I fixed this problem by upgrading from DataTables 1.10.0 to 1.10.3. Apparently earlier versions of DataTables had a conflict between deferRender and downloading of the files. See: https://datatables.net/forums/discussion/20266/tabletools-not-exporting-all-rows-with-bserverside-false-when-via-ajax#latest