2022-03-26 23:33:57 +01:00
|
|
|
// Tableau recap notes
|
|
|
|
$(function () {
|
|
|
|
$(function () {
|
|
|
|
$('table.table_recap').DataTable(
|
|
|
|
{
|
|
|
|
paging: false,
|
|
|
|
searching: true,
|
|
|
|
info: false,
|
|
|
|
autoWidth: false,
|
|
|
|
fixedHeader: {
|
|
|
|
header: true,
|
|
|
|
footer: true
|
|
|
|
},
|
|
|
|
orderCellsTop: true, // cellules ligne 1 pour tri
|
|
|
|
aaSorting: [], // Prevent initial sorting
|
|
|
|
colReorder: true,
|
|
|
|
"columnDefs": [
|
|
|
|
{
|
|
|
|
// cache le détail de l'identité (pas réussi à le faire avec le sélecteur css)
|
|
|
|
"targets": [1, 2, 3], // ".identite_detail",
|
|
|
|
"visible": false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
dom: 'Bfrtip',
|
|
|
|
buttons: [
|
|
|
|
'copy', 'excel', 'pdf',
|
|
|
|
{
|
|
|
|
extend: 'collection',
|
|
|
|
text: 'Réglages affichage',
|
|
|
|
autoClose: true,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
name: "toggle_ident",
|
|
|
|
text: "Civ/Nom/Prénom",
|
|
|
|
action: function (e, dt, node, config) {
|
|
|
|
let visible = dt.columns(".identite_detail").visible()[0];
|
|
|
|
dt.columns(".identite_detail").visible(!visible);
|
|
|
|
dt.columns(".identite_court").visible(visible);
|
|
|
|
dt.buttons('toggle_ident:name').text(visible ? "Civ/Nom/Prénom" : "Nom");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "toggle_res",
|
|
|
|
text: "Cacher les ressources",
|
|
|
|
action: function (e, dt, node, config) {
|
|
|
|
let visible = dt.columns(".col_res").visible()[0];
|
|
|
|
dt.columns(".col_res").visible(!visible);
|
|
|
|
dt.buttons('toggle_res:name').text(visible ? "Montrer les ressources" : "Cacher les ressources");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "toggle_sae",
|
|
|
|
text: "Cacher les SAÉs",
|
|
|
|
action: function (e, dt, node, config) {
|
|
|
|
let visible = dt.columns(".col_sae").visible()[0];
|
|
|
|
dt.columns(".col_sae").visible(!visible);
|
|
|
|
dt.buttons('toggle_sae:name').text(visible ? "Montrer les SAÉs" : "Cacher les SAÉs");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
2022-03-27 18:49:15 +02:00
|
|
|
$('table.table_recap tbody').on('click', 'tr', function () {
|
|
|
|
if ($(this).hasClass('selected')) {
|
|
|
|
$(this).removeClass('selected');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('table.table_recap tr.selected').removeClass('selected');
|
|
|
|
$(this).addClass('selected');
|
|
|
|
}
|
|
|
|
});
|
2022-03-26 23:33:57 +01:00
|
|
|
});
|