Print some rows add with jquery append function
Print some rows add with jquery append function
ningollan
Posts: 6Questions: 2Answers: 0
Hi all,
I have a question :
- I have a dataTable and in the fnDrawCallback function i add a final line with the total of some columns
- When i use the print button (provided in plugins), it only takes the dataTable without my added lines
How can i print those lines ?
Best regards.
This discussion has been closed.
Answers
Hi @ningollan ,
You would use
buttons.exportData()
- that method is sent the data, which you can then manipulate.Cheers,
Colin
Hi @colin
Thanks for your answer, but i can't see how this method could help me..
With the row-selector ?
Cheers
I try with this, but the row selector can't find any row with my class myCustomClass)...
Example :
And i add this in my dataTable conf :
'buttons': [
{
extend: 'print',
text: 'Print current page',
exportOptions: {
rows: ['.rapportTotal', '.odd']
}
}
]
But it only prints the odd line and not all the lines...
Do you have an idea ?
Hi @ningollan ,
I went down a different route in the end. My last answer was based on the print button's
exportOptions
, so a bit misleading sorry. This here does what you want, I believe,Cheers,
Colin