Add a print button on each row
Add a print button on each row

Hello everyone,
I need to let my users print one row at a time. In the past I've used the print button at the top to allow the users to use a checkbox to print one or more rows. Unfortunately in this case I cannot use that same functionality, and this is why I've been looking for an example to add a button to each row and trigger the print from it.
Has anyone seen/done something similar with Datatables?
Thanks in advance,
Manuel
This question has an accepted answers - jump to answer
Answers
Here are a couple examples of creating buttons.
Uses
columns.defaultContent
:http://live.datatables.net/xijecupo/1/edit
Uses
columns.render
:http://live.datatables.net/qemodapi/1/edit
These aren't the Datatables Extension buttons. You would need to still create the normal print button but you could hide it, maybe something like this thread . The you would use the
button().trigger()
API to trigger the button in your event handler.HTH,
Kevin
I ended up using the columns.render to add a button and call a function with the index of each row. Once I had the index, I collected the row data and printed it using a regular window.print().
Thanks for your assistance Kevin!!