How to set a document's title (excelHtml5 and pdfHtml5) from a text field?
How to set a document's title (excelHtml5 and pdfHtml5) from a text field?
ricky2k7
Posts: 2Questions: 1Answers: 0
Hi, I need to change the title of an exported list (excelHtml5 and pdfHtml5) based on the value of an input field.
The idea is for the user to change the exported files title based on their searches.
For now all my buttons have the same title value:
{
extend: 'excelHtml5',
title: 'Title 1', //change this value based on an input field
},
{
extend: 'pdfHtml5',
title: 'Title 2', //change this value based on an input field
}
How can i accomplish this?
This discussion has been closed.
Answers
With jQuery you can grab the text input directly from your input field using a selector.
This is what the HTML looks like:
Then do this for the title:
Hi j.cue, thanks for the reply.
I've tried that but it doesn't work.
The title variable is only loaded once with the datatable.
I found a way to update the title property: