how to set exported file name # dom: 'lBfrtip'

how to set exported file name # dom: 'lBfrtip'

debanjanrkmbhdebanjanrkmbh Posts: 3Questions: 2Answers: 0
edited December 2015 in Free community support

I am trying to set the exported file name. but it is taking page title name. My code is bellow.

dom: 'lBfrtip',
buttons: [{ extend: 'csvHtml5', text: 'Export to CSV'}],
 "tableTools": {
                "aButtons": [{ "sExtends": "xls", "sTitle": "File Name.csv", "sFileName": "File     Name.csv", "sButtonText": "Export to CSV", "oSelectorOpts": { filter: 'applied', order: 'current'} }
                ]
            },

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    edited December 2015 Answer ✓

    See the csvHtml5 reference documentation (specifically the title option). edit - Should be title as I've now corrected it.

    Note that TableTools should not be used at the same time as the Buttons extension. They could be, but I don't see why you would want to!

    Allan

  • debanjanrkmbhdebanjanrkmbh Posts: 3Questions: 2Answers: 0

    Its working now.
    Thanks a ton allan!

This discussion has been closed.