Fix JS per stampa footer tabelle

This commit is contained in:
Dasc3er 2021-07-29 10:44:03 +02:00
parent 016dfdf098
commit d9bb35c33c
2 changed files with 3 additions and 6 deletions

View File

@ -83,7 +83,7 @@ $(document).ready(function () {
// Gestione click sulla sidebar per evitare chiusura // Gestione click sulla sidebar per evitare chiusura
$(".control-sidebar").on("click", function (e) { $(".control-sidebar").on("click", function (e) {
if (largeScreen && e.target.tagName !== 'H4' && $(".main-footer").hasClass("with-control-sidebar")) { if (largeScreen && e.target.tagName === 'A' && $(".main-footer").hasClass("with-control-sidebar")) {
toggleControlSidebar(); toggleControlSidebar();
} }
}); });

View File

@ -219,17 +219,14 @@ function getDatatablesButtons(table) {
extend: 'print', extend: 'print',
autoPrint: true, autoPrint: true,
footer: false, // Non funzionante in Firefox, e saltuarmente in Chrome footer: false, // Non funzionante in Firefox, e saltuarmente in Chrome
customize: function (win) { customize: function (win, config, datatable) {
const datatable = getTable(table).datatable;
const footer = datatable.table().footer().children[0]; const footer = datatable.table().footer().children[0];
console.log(footer);
const body = $(win.document.body); const body = $(win.document.body);
body.find('table') body.find('table')
.addClass('compact') .addClass('compact')
.css('font-size', 'inherit') .css('font-size', 'inherit')
.append(footer); .append(footer.cloneNode(true));
body.find('td:first-child, th:first-child') body.find('td:first-child, th:first-child')
.addClass('hide'); .addClass('hide');