I would like for my users to be able to print the content of a modal window.
I tried to use the plugin https://wordpress.org/plugins/print-o-matic/ but it doesn't appear to be one that works with wpDataTable as its shortcode is not recognized and the way wpDataTable translates it breaks the code.
My current solution is to add a js alongside my wpDataTable:
<script> function printDiv(divName){var printContents = document.getElementById(divName).innerHTML; var originalContents = document.body.innerHTML; document.body.innerHTML = printContents; window.print(); document.body.innerHTML = originalContents;} </script>
and include the following code inside what's showing in the modal:
We don't have native integration with any similar plugins, so what you're looking for to achieve falls under custom work. Unfortunately, we do not provide support for custom work, so I'm not able to help you with this.
I've never worked with this plugin, and I don't know how it works.
Hello,
I would like for my users to be able to print the content of a modal window.
I tried to use the plugin https://wordpress.org/plugins/print-o-matic/ but it doesn't appear to be one that works with wpDataTable as its shortcode is not recognized and the way wpDataTable translates it breaks the code.
My current solution is to add a js alongside my wpDataTable:
<script>
function printDiv(divName){var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;}
</script>
and include the following code inside what's showing in the modal:
<button onclick="printDiv('printMe')">Print</button>
<div id="printMe">What I want to be printed</div>
Here are the challenges I have with this solution:
1. It only works on desktops (I can live with that and hide the print button on smaller screens.)
2. Regardless of screen size, the only way to close the modal once it has been printed is to refresh the whole page, which is a bit annoying.
How would you recommend I do this?
Thank you
Hello again Sebastian
We don't have native integration with any similar plugins, so what you're looking for to achieve falls under custom work. Unfortunately, we do not provide support for custom work, so I'm not able to help you with this.
I've never worked with this plugin, and I don't know how it works.
Sorry.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
No worries.
Thank you.
You're welcome, Sebastian
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables