I have a DataTable that includes yadcf filters in the header. Therefore, when I use the export to PDF and Excel buttons, I would like the column titles of those reports to come from the footer of the DataTable. How would I accomplish that?
My current buttons code gets the header of the DataTable without the yadcf filter options. However, I would like to remove the header completely so that I can use the default text in the yadcf filters as the column titles.
buttons: [
{
extend : 'excel',
exportOptions : {
format : {
header : function (mDataProp, columnIdx) {
var htmlText = '<span>' + mDataProp + '</span>';
var jHtmlObject = jQuery(htmlText);
jHtmlObject.find('div').remove();
var newHtml = jHtmlObject.text();
return newHtml;
}
}
}
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
exportOptions: {
format : {
header : function (mDataProp, columnIdx) {
var htmlText = '<span>' + mDataProp + '</span>';
var jHtmlObject = jQuery(htmlText);
jHtmlObject.find('div').remove();
var newHtml = jHtmlObject.text();
return newHtml;
}
}
}
},
],