Hello!
J'ai cette erreur:
> TypeError: m[n] is undefined
J'utlise Symfony 4.2. Mon Twig:
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  <table id="tableauProf" class="table-sm table-striped table-hover " width="100%" cellspacing="0"  style="font-size:14px !important">
              <thead>
                <tr>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                </tr>
              </thead>
              <tbody>
                {% for elementListePointage in listeDePointage %}
                  <tr>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                                          <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                      <td>A</td>
                  </tr>
                {% endfor %}
              </tbody>
              <tfoot>
                <tr>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                  <th>A</th>
                </tr>
              </tfoot>
            </table>
Mon fichier JS:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
$(document).on("click", function() {
  $('[data-toggle="tooltip"]').tooltip()
});
 
 
$(document).ready(function() {
  $.fn.dataTable.ext.errMode = 'none';
  $(function () {
    $('[data-toggle="tooltip"]').tooltip()
  });
  $('#tableauProf thead td').each(function () {
      var title = $('#tableauProf tfoot th').eq( $(this).index() ).text();
      $(this).html( '<input class="form-control form-control-sm" type="text" placeholder="'+title+'" />'  );
  } );
  var table = $('#tableauProf').DataTable( {
      // dom: '<lf<t>ip>',
      dom: 'lBtip',
      lengthMenu: [
          [ -1, 10, 25, 50, 100 ],
          [ 'Voir tout', '10', '25', '50', '100' ]
      ],
      buttons: [
        // {
        //   extend:     'pageLength',
        //   className:  'shadow-sm mr-2',
        // },
        {
          extend:     'pdf',
          exportOptions: {
            columns: [ 0, 1, 2, 3, 4, 5 ]
        },
          text:       '<i class="fas fa-download"></i> PDF',
          className:  'shadow-sm',
        },
        {
          extend:     'csv',
          exportOptions: {
            columns: [ 0, 1, 2, 3, 4, 5 ]
        },
          text:       '<i class="fas fa-download"></i> CSV',
          className:  'shadow-sm',
        },
      ],
      // scrollY:        "300px",
      // scrollX:        true,
      // scrollCollapse: true,
      // paging:         true,
      order: [[ 1, "desc" ], [ 3, "desc" ]],
      columnDefs: [
        { orderable: false, targets: [0,1,2,3,4,5] },
        { searchable: false, targets: [2,3,8,10,11,12] },
        { visible: false, targets: [7] },
        { className: 'dt-right', targets: [7,9] },
        { className: 'dt-center', targets: [11,12] },
        {
            targets: 7,
            render: function ( data, type, row ) {
              return data > 0 ? "<span class='badge badge-warning'>Retard</span>" : "";
            },
        },
        {
            targets: 9,
            render: function ( data, type, row ) {
              return data == 1 ? "<span class='badge badge-danger'>Sorti en avance</span>" : "";
            },
        },
        {
            targets: 11,
            render: function ( data, type, row ) {
              return data == 1 ? "<span class='btn btn-sm bg-success rounded-pill text-white'><i class='fas fa-check'></i></span>" : "";
            },
        },
        {
            targets: 12,
            data: null,
            render: function ( data, type, row ) {
              if(row[7]!=0 || row[9]==1 || row[11]==1){
                if(row[11]==1){
                  return "<button class='btn btn-success btn-sm rounded-circle'><i class='fas fa-check'></i></button>";
                } else {
                  return "<button class='btn btn-primary btn-sm rounded-circle'><i class='fas fa-check'></i></button>";
                }
              }
            },
        },
      ],
      language: {
        "sEmptyTable":     "Aucune donnée disponible dans le tableau",
        "sInfo":           "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments",
        "sInfoEmpty":      "Affichage de l'élément 0 à 0 sur 0 élément",
        "sInfoFiltered":   "(filtré à partir de _MAX_ éléments au total)",
        "sInfoPostFix":    "",
        "sInfoThousands":  ",",
        "sLengthMenu":     "Afficher _MENU_ éléments",
        "sLoadingRecords": "Chargement...",
        "sProcessing":     "Traitement...",
        "sSearch":         "Rechercher :",
        "sZeroRecords":    "Aucun élément correspondant trouvé",
        "oPaginate": {
          "sFirst":    "Premier",
          "sLast":     "Dernier",
          "sNext":     "<i class='fas fa-arrow-right'></i>",
          "sPrevious": "<i class='fas fa-arrow-left'></i>"
        },
        "oAria": {
          "sSortAscending":  ": activer pour trier la colonne par ordre croissant",
          "sSortDescending": ": activer pour trier la colonne par ordre décroissant"
        },
        "select": {
                "rows": {
                  "_": "%d lignes sélectionnées",
                  "0": "Aucune ligne sélectionnée",
                  "1": "1 ligne sélectionnée"
                }
        }
      },
  } );
  // Apply the search
    table.columns().every( function () {
      var that = this;
 
      $( 'input', this.header() ).on( 'keyup change', function () {
          if ( that.search() !== this.value ) {
              that
                  .search( this.value )
                  .draw();
          }
      } );
  } );
 
  table.buttons().container()
    .appendTo( $('.col-sm-6:eq(0)', table.table().container() ) );
 
} );
Quelqu'un voit-il ce qui pose problème ? Côté JS ou TWIG. Merci!