Initialisation

Initialisation

evpf29bevpf29b Posts: 6Questions: 4Answers: 0
edited September 2022 in Free community support

Bonjour
Je ne comprends plus rien.

tableau.js

$(document).ready(function () {
        $('#tab').DataTable({
            
        "scrollY": 440,
        "scrollX": true,
        
        select: true,
        
        dom: 'lftrip',
        pagingType: "full_numbers",
        order:[2, 'asc'],
        
        buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
        
        
        lengthMenu:[5,10,15,20,25],
        pageLength: 15,
        language: {
            url: "French.json"
        }
    });

});

lecture.php

<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="tableau-fichier.js"></script>




<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/searchpanes/2.0.2/css/searchPanes.dataTables.css"/>
 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/searchpanes/2.0.2/js/dataTables.searchPanes.js"></script>

etc.....

rien ne passe, pas de boutons, pas de modification de l'aspect de mon tableau.

En fait quoi que je modifie comme script il n'est pas pris en compte.

Merci de votre aide.

Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769
    Answer ✓

    First you need to tell Datatables to display the buttons as described here. The easiest is to add B to the dom option. You need to do the same for SearchPanes as described here by adding P to the dom option.

    It doesn't look like you are loading jszip.js which is required for Excel export. Use the Download Builder to get all the files you need.

    Kevin

  • evpf29bevpf29b Posts: 6Questions: 4Answers: 0

    merci beaucoup c'est parfait

Sign In or Register to comment.