Is there a way for me to "print" selected rows even if they aren't in the table?
Is there a way for me to "print" selected rows even if they aren't in the table?

dom: 'Bfrtip',
buttons: [
{
extend: 'copy',
text: 'Copy selected to clipboard',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
},
{
extend: 'csv',
text: 'Save selected as CSV',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
},
{
extend: 'excel',
text: 'Save selected as Excel',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
},
{
extend: 'pdf',
text: 'Save selected as PDF',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
},
{
extend: 'print',
text: 'Print selected',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
}
],
This is my button config. But I noticed that the rows won't print even if selected for as long as the search box has some text inside it, it will only print the selected row within that table with the search on.
Eg, There are 50 rows, and I selected 5 rows, then I typed some text inside the search box, and it matched 2 rows, I selected one of them. So it says I have 6 selected rows. But it doesn't print the other 5 rows since those don't match the one in the search box, it will only print/export the rows selected with the values matching inside the search box.
Can I make it as the rows selected will print regardless if the search box is empty or not?
Thanks!
Replies
See if this example helps:
https://datatables.net/extensions/buttons/examples/print/select.html
Kevin
It is the exact example I used, and that also has the same effect as to the problem I stated above.
As the example states you can use a
selector-modifier
to control the rows that are printed. Looks like you should use{ search:'applied', selected: true }
, like this example:http://live.datatables.net/geratebi/1/edit
Kevin