TypeError: e[i] is undefined

TypeError: e[i] is undefined

ZarkoffeZarkoffe Posts: 2Questions: 1Answers: 1
edited May 2020 in Free community support

Hello,
I have this error : TypeError: e[i] is undefined
Someone have an idea that i must change in my code?
My table HTML:

{% for elementListePointage in CoursParProf %} {% endfor %}
Nom du cours N° groupe TD
Nom du cours N° groupe TD
{{ elementListePointage.nomUe }} {{ elementListePointage.groupeTd }}
Nom du cours N° groupe TD
{% endblock %}
{% block javascripts %}
    <script src="{{ asset('js/initAdminListe.js') }}"></script>
{% endblock %}

Then, my JS (initAdminListe.js) :
$(document).on("click", function() {
$('[data-toggle="tooltip"]').tooltip()
});

$(document).ready(function() {
  $.fn.dataTable.ext.errMode = 'none';
  $(function () {
    $('[data-toggle="tooltip"]').tooltip()
  });
  $('#tableauListe thead td').each(function () {
      var title = $('#tableauListe tfoot th').eq( $(this).index() ).text();
      $(this).html( '<input class="form-control form-control-sm" type="text" placeholder="'+title+'" />'  );
  } );
  var table = $('#tableauListe').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 ]
        },
          text:       '<i class="fas fa-download"></i> PDF',
          className:  'shadow-sm',
        },
        {
          extend:     'csv',
          exportOptions: {
            columns: [ 0, 1]
        },
          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] },
        { searchable: false, targets: [0, 1] },
        { visible: false, targets: [1] },
        { className: 'dt-right', targets: [0, 1] },
        { className: 'dt-center', targets: [0, 1] },
        /*{
            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><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 fa-1x'></i></button><button class='btn btn-danger btn-sm rounded-circle'><i class='fas fa-times fa-lg'></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() ) );

} );

Thank you :)

This question has an accepted answers - jump to answer

Answers

  • ZarkoffeZarkoffe Posts: 2Questions: 1Answers: 1
    Answer ✓

    i found the answer :
    order: [[ 0, "desc" ], [ 1, "desc" ]],

This discussion has been closed.