diff --git a/app/static/js/table_recap.js b/app/static/js/table_recap.js index 6bfa63aa2525996761d7670c0e50a350e5581f93..bcad68c14a4d5891e5e393288bb47ecc88b33012 100644 --- a/app/static/js/table_recap.js +++ b/app/static/js/table_recap.js @@ -74,11 +74,8 @@ $(function () { toggle_col_group_visibility(dt, "col_malus", onoff); } function toggle_col_group_visibility(dt, group, onoff) { - if (onoff) { - dt.columns("." + group).visible(false); - } else { - dt.columns("." + group).visible(true); - } + dt.columns("." + group).visible(!onoff, false); + dt.columns.adjust(); update_buttons_labels(dt); } // Definition des boutons au dessus de la table: @@ -203,11 +200,17 @@ $(function () { info: false, autoWidth: false, scrollX: true, - fixedColumns: { // fige les 3 colonnes de gauche - start: 3 - }, + // fixedColumns: { // fige les 3 colonnes de gauche + // start: 3 + // }, + // provoque trop de bugs d'affichage XXX initComplete: function (settings, json) { - // fixe la largeur de la table (évite décalages colonnes) + // fixe la largeur de la table (évite décalages colonnes) ?? + document.querySelectorAll("table.dataTable").forEach((table) => { + table.style.width = document.querySelector( + "#DataTables_Table_0_wrapper .dt-scroll-head .dt-scroll-headInner" + ).style.width; + }); document.getElementById("DataTables_Table_0").style.width = document.querySelector( "#DataTables_Table_0_wrapper .dt-scroll-head .dt-scroll-headInner"