help for : write search criteria text as pdf export file's messageTop text
help for : write search criteria text as pdf export file's messageTop text
infotba
Posts: 17Questions: 3Answers: 0
if the search text is Tokyo then messageTo : Tokyo
Please help.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
In the messageTop function return
search()
without any parameters. This should provide the global search value.Kevin
dom: 'Bfrtip',
buttons: [
{
extend: 'pdfHtml5',
messageTop:function () {
var dateNow = new Date();
return dateNow.toLocaleString();
},
orientation: 'landscape',
pageSize: 'A4',
ok for date but search() not
thank you
I don't see the
search()
method being called in yourmessageTop
function. Could you provide a link to a page showing the issue please.Allan
...
dom: '<Bf<t>lip>',
buttons: [
{
extend: 'pdfHtml5',
messageTop:$('#dataTables_filter input').val(),
orientation: 'landscape',
pageSize: 'A4',
....
Have you tried this?
Where
table
is your Datatables API variable.Kevin
function () {
var table = $('#example').DataTable();
return 'Search: ' + table.search();
},
excellent solve.Thank you kthorngren.