Printout: Get rid of TV footer (sum-row + num records)

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1869
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Printout: Get rid of TV footer (sum-row + num records)

Post by jsetzer » 2024-08-29 05:10

Just a very quick one:

I rarely use the built-in printing feature. However, for a simple printout of a table, I was bothered by the printing of the Sum row as well as the Records 1 to n of m row.

chrome_UEnIeBUeyq.png
chrome_UEnIeBUeyq.png (20.97 KiB) Viewed 261 times

With the following Javascript code, which I put in hooks/footer-extras.php, I hide these two lines - but only in the print output:

Code: Select all

<script>
    // file: hooks/footer-extras.php
    jQuery(function () {
        jQuery("table[data-tablename] > tfoot").addClass("hidden-print");
        jQuery("table[data-tablename] > tbody > tr.sum").addClass("hidden-print");
    });
</script>
chrome_SAS6xuyYGD.png
chrome_SAS6xuyYGD.png (42.92 KiB) Viewed 261 times

That's better for me in this case.


Notes
  • Change will not yet be visible in print preview page (after clicking [Print Preview]-button) because preview (HTML-) page is still screen-output (@media = screen).
  • Change will be visible in print-preview popup page (your printing dialog) after clicking [Print]-button, as that browser-dialog shows print-output (@media = print).
    chrome_sbePbNt7la.png
    chrome_sbePbNt7la.png (23.6 KiB) Viewed 261 times
Tips
  • That script in footer-extras.php changes every printout. If you need it for a certain table, only, simply put the javascript code in hooks/TABLENAME-tv.js.
  • I've seen a few questions here about hiding this and that in printout. Next to all the given answers of modifying templates etc. you can also use that Bootstrap class .hidden-print on the DOM-Elements you'd like to hide in print-output.

I hope this helps someone some day.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

Post Reply