PDF button custom header dynamic

PDF button custom header dynamic

m75sam75sa Posts: 132Questions: 30Answers: 0
edited May 2023 in Free community support

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

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    This example from this thread should help, it's showing how to use the search string in the title,

    Colin

  • m75sam75sa Posts: 132Questions: 30Answers: 0

    thanks a lot @colin

Sign In or Register to comment.