How to call print button in my function
How to call print button in my function
mamadsoli
Posts: 28Questions: 5Answers: 1
Hello, how to can call print function in datatables
?
I need to call print function in my custom button...
(without define any print buttons in my page, I only have my custom button)
buttons: [
{
text: 'My Print Button',
action: function (e, dt, node, config) {
// Some code before call print function
// Now call print
table.printFuction(e, dt, node, config);
// Some code after call print function
});
}
]
thanks
This question has accepted answers - jump to:
Answers
Have a look at that last example in the
buttons.buttons.action
documentation for how to do what you are looking for.DataTable.ext.buttons.print.action
is the function you want.Allan
Thank you very much
Excuse me, I write this code, but I don't have columns on output.
Can you tell me where's my wrong? thank you
Its difficult to debug code snippets. Please provide a simple test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I found it.
I have to set this code too:
or
Thank you