Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tableMembres() {
- $('#membre-table').DataTable({
- searching: true,
- ordering: true,
- processing: false,
- "paging": true,
- "language": {
- "buttons": {
- "copyKeys": "Appuyer sur ctrl ou u2318 + C pour copier les données du tableau dans votre presse-papier.",
- "collection": "Collection",
- "colvis": "Visibilité colonnes",
- "colvisRestore": "Rétablir visibilité",
- "copy": "Copier",
- "copySuccess": {
- "1": "1 ligne copiée dans le presse-papier",
- "_": "%d lignes copiées dans le presse-papier"
- },
- "copyTitle": "Copier dans le presse-papier",
- "csv": "CSV",
- "excel": "Excel",
- "pageLength": {
- "-1": "Afficher toutes les lignes",
- "1": "Afficher 1 ligne",
- "_": "Afficher %d lignes"
- },
- "pdf": "PDF",
- "print": "Imprimer"
- },
- "lengthMenu": "Afficher les enregistrements _MENU_ par page",
- "zeroRecords": "Aucun membre disponible avec cet indice",
- "info": "Affichage de la page _PAGE_ de _PAGES_",
- "infoEmpty": "Aucun enregistrement disponible",
- "infoFiltered": "(filtré à partir du nombre total d'enregistrements _MAX_ )",
- "sSearch": "Rechercher :",
- "paginate": {
- "first": "Premier",
- "last": "Dernier",
- "next": "Suivant",
- "previous": "Précédent"
- },
- "loadingRecords": "Chargement...",
- "processing": "Traitement..."
- },
- "search": {
- "caseInsensitive": true
- },
- dom: 'Bfrtip',
- buttons: [
- {
- extend: 'colvis',
- collectionLayout: 'fixed two-column',
- text: '<i class="fas fa-columns"></i>',
- titleAttr: 'Visibilité de la colonne'
- //className: 'classes here'
- },
- {
- extend: 'excelHtml5',
- exportOptions: { columns: [ 1, 2, 3, 4, 5, 6, 7 ]},
- text: '<i class="far fa-file-excel"></i>',
- title: 'Liste des membres',
- titleAttr: 'Exportation Excel'
- },
- {
- extend: 'pdfHtml5',
- text: '<i class="far fa-file-pdf"></i>',
- titleAttr: 'Exportation PDF',
- download: 'open',
- messageTop: 'PDF créé par la C.A.M.A.R',
- title: 'Liste des membres',
- footer: true,
- //orientation: 'landscape',
- pageSize: 'A4',
- exportOptions: {
- columns: ':visible',
- search: 'applied',
- order: 'applied'
- },
- exportOptions: { columns: [ 1, 2, 3, 4, 5, 6, 7, 8 ]},
- customize: function (doc) {
- doc.content.splice( 1, 0, {
- margin: [ 0, 0, 0, 22 ],
- width: 130,
- height: 130,
- opacity: 0.9,
- alignment: 'center',
- image: 'data:image/png;base64,'+ image_logo // Variable image base64
- });
- doc.defaultStyle.alignment = 'center';
- }
- },
- {
- extend: 'print',
- exportOptions: { columns: [ 1, 2, 3, 4, 5, 6, 7, 8 ]},
- text: '<i class="fas fa-print"></i>',
- titleAttr: 'Impression',
- alignment: 'center'
- },
- {
- extend: 'copyHtml5',
- exportOptions: { columns: [ 1, 2, 3, 4, 5, 6, 7, 8 ]},
- copyTitle: 'Ajouté au presse-papiers',
- text: '<i class="far fa-copy"></i>',
- titleAttr: 'Copier'
- }
- ],
- columnDefs: [
- { targets: -1, className: 'dt-body-center' },
- { orderable: false, targets: 0 },
- { orderable: false, targets: 7 },
- { orderable: false, targets: 9 },
- { targets: 1, className: 'noVis' }
- ],
- order: [[1, 'asc']],
- responsive: true,
- "pagingType": "simple_numbers",
- "pageLength": 5,
- "lengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "Tout"]]
- });
- $('#membre-table').DataTable().column(2).visible(false);
- $('#membre-table').DataTable().column(7).visible(false);
- }
Add Comment
Please, Sign In to add comment