Marcos Delgado
Marcos Delgado

Reputation: 197

How to give dynamic file name in JQuery datatables for PDF File?

I am not able to find a perfect example in which I can see how to set the filename dynamically for my PDF file in datatables. I am using datatables version 1.10.0 and tabletools version 2.2.4.

Upvotes: 0

Views: 438

Answers (1)

Ja9ad335h
Ja9ad335h

Reputation: 5075

you can use sTitle property of tableTools configs

var fileName = (function() {
    //run your logic to generate dynamic file name;
    return "computedFileName";
})();

then

tableTools: {
    "aButtons": [
        {
            "sExtends": "pdf",
            "sTitle": fileName 
        }
    ]
}

Upvotes: 1

Related Questions