This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 3 years, 5 months ago.

Excel / PDF buttons for Ajax Datatable


  • Volder
    Participant

    Posts: 1
    Member Reply #3012

    Hello

    I’m trying to add save as / export buttons for Ajax datatables similar to the way described here:

    http://keenthemes.com/forums/topic/ajax-datatables-with-pdf-csv-excel-print-copy-buttons/

    The problem is if I copy the files you provided there – then all buttons appear (however, while there is no real ajax query happens – the buttons are not working in your example).

    When I adjust my file by adding three things:
    <pre style=”background-color: #2b2b2b; color: #a9b7c6; font-family: ‘Courier New’; font-size: 15pt;”>
    $.extend(true, $.fn.DataTable.TableTools.classes, {

    "container": "btn-group tabletools-dropdown-on-portlet",

    "buttons": {

    "normal": "btn btn-sm default",

    "disabled": "btn btn-sm default disabled"

    },

    "collection": {

    "container": "DTTT_dropdown dropdown-menu tabletools-dropdown-menu"

    }

    });

    and then

     

     

    "dom": "<'row'<'col-md-6 col-sm-12'pli><'col-md-6 col-sm-12'T>r><'table-scrollable't><'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>>", // datatable layout

    and finally

     

     

    "tableTools": {

    "sSwfPath": "/assets/global/plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",

    "aButtons": [{

    "sExtends": "pdf",

    "sButtonText": "PDF"

    }, {

    "sExtends": "csv",

    "sButtonText": "CSV"

    }, {

    "sExtends": "xls",

    "sButtonText": "Excel"

    }, {

    "sExtends": "print",

    "sButtonText": "Print",

    "sInfo": 'Please press "CTR+P" to print or "ESC" to quit',

    "sMessage": "Generated by DataTables"

    }]

    }

    However, I see only “Print” button, but not the rest.

    The print button is working.

    Could you please advise on what the problem could be? Spent on the issue 2 days and still no luck. I think it could be some logic within .swf file, which I can’t access.

     

    There is also another issue with styling produced by the buttons block – it basically makes the paging not fitting on the page – see attached files.

     

    Thanks for your help.

    Attachments:
    You must be logged in to view attached files.
    Sean
    Sean
    Keymaster

    Posts: 4527
    Support Staff Reply #3019

    Hi,

    Thanks for your feedback on this.

    At the moment we are working on some demos that merges the datatable’s extension for single tables.  However we are doing this demos on the latest datatables version and hopefully we will be able to release in a few days.

    Thanks.

You must be logged in to reply to this topic.