Data not appearing except if i use the sort function

Data not appearing except if i use the sort function

ZappellinZappellin Posts: 1Questions: 1Answers: 0

I fetch some data from an API to a table, then transform the table into a Datatable, when the page is loaded I see the data, then they disappear, and I need to sort to make them reappear.

It's used to work but not anymore

here is my code sample :

let table = $('#liste_rdv1').DataTable({
        "language": {
            "sProcessing": "Traitement en cours...",
            "sSearch": "Rechercher :",
            "sLengthMenu": "Afficher _MENU_ éléments",
            "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é de _MAX_ éléments au total)",
            "sInfoPostFix": "",
            "sLoadingRecords": "Chargement en cours...",
            "sZeroRecords": "Aucun élément à afficher",
            "zeroRecords": "Aucun rapport à afficher",
            "sEmptyTable": "Aucune donnée disponible dans le tableau",
            "oPaginate": {
                "sFirst": "Premier",
                "sPrevious": "Précédent",
                "sNext": "Suivant",
                "sLast": "Dernier"
            }
        },
        "searching": true,
        "ordering": true,
        "sortable": true,
        "pageLength": 25,
        "bLengthChange": false,
        "bInfo": false,
        "bFilter": false,
        "order": [2, "asc"],
    });

Answers

  • kthorngrenkthorngren Posts: 21,174Questions: 26Answers: 4,923

    when the page is loaded I see the data

    Is this before or after Datatable is initialized?

    then they disappear

    The init code you posted isn't enough information to help debug. There must be something else happening on your page.

    I need to sort to make them reappear.

    There are no known datataables issues that would cause this behavior. Please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

This discussion has been closed.