PDF button custom header dynamic
PDF button custom header dynamic
I need to customize the pdf export header by adding the date of the selected datatables calendar.
But it seems to don't work.
So i have the datatables calendar with an input field called #min
<input type="text" id="min" name="min" >
and the custom pdf export button like this:
{ extend: 'pdf', title: 'TITLE DATE IS '+$('#min').val(), text: '<a class="btn" style="color: #FFFFFF; padding: 0 !important; height: fit-content !important;"><i class="fas fa-file-pdf"></i> PDF</a>', orientation: 'landscape',
...
in this case, in the pdf i can see the header title without the date selected in the calendar
I also used cookies to store values and get it dynamically but the same, the value is empty
any help
This question has an accepted answers - jump to answer
Answers
This example from this thread should help, it's showing how to use the search string in the title,
Colin
thanks a lot @colin