Print tab automatically close when autoPrint: true
Print tab automatically close when autoPrint: true
smridha
Posts: 1Questions: 0Answers: 0
Hello,
I am facing a problem with datatable print. I am working with a laravel project and when I press print button another tab open with my table data and then just before of preview the tab close automatically. It is happening only on chrome.
This discussion has been closed.
Replies
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
I have the same problem.
Seems that win.print() is not blocking function in buttons.print.js (at least in Chrome). Or for some reasons in some cases it is non blocking. For me, with large data set (25 page), the window is usually closed since win.print not block execution. But there was case, when it blocked execution, usually, at the first print button click. Later, it will open and close, without print window.
var autoPrint = function () {
if ( config.autoPrint ) {
win.print(); // blocking - so close will not
win.close(); // execute until this is done
}
};
maybe it happens because according to spec https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#printing
So, the user agent only set flag "print when loaded" on win.print() and return execution.
Could well be! What happens if you do:
?
Allan