No parameter return to the server

No parameter return to the server

Gilles BouchardGilles Bouchard Posts: 4Questions: 2Answers: 0
edited November 2021 in Priority support

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
draw, start and length are empty on the server side:
The ajax call works but no parameters are transferred to the server.
I put a breakpoint in the data section of the datatable and the data object is empty.
This is the table code and where I put a breakpoint:

table = $('#GridClesApi').DataTable({
       // responsive: true,
        stateSave:true,
        processing: true,
        serverside: true,
        paging: true,
        dom: 'Bfrtip',
        searching: { regex: true },
        ajax: {
            url: "/api/clesapi/chargegrilleCles",
            type: "POST",
            contentType: "application/json",
            dataType: "json",
            data: function (d) {
                return JSON.stringify(d);  <====== d is empty here
            }
        },
        columnDefs: [{
            targets: [0],
            visible: false,
            searchable: false

        }],
        columns: [
            {
                name: "Id",
                data: "Id",
                width: "5%"
            },
            {
                data: "Cle",
                width: "10%"
            },
            {
                data: "Client",
                width: "25%"
            },
            {
                data: "Action",
                width: "15%"
            },
            {
                //Bouton d'actions
                data: null,
                className: "grid-action-buttons",
                width: "15%",
                render: function (data, type, row) {

                    let buttonModified = `<li title="${LBLModify}" onclick="onClickModifyCleAPIFromGrid('${data.Id}')" class="btn btn-warning btn-customize-hq fas fa-pencil-alt"­></li>`;
                    let buttonDelete = `<li title="${LBLDelete}" onclick="onClickDeleteCleAPIFromGrid('${data.Id}')" class="btn btn-danger btn-customize-hq far fa-times" ></li>`;

                    return `<div class="grid-column-crud-button-section"><ul class="crud-ul-section">${buttonModified}${buttonDelete}</ul></div>`;
                },
                orderable: false
            }
        ],
        //order: [[5, "desc"]],
       // language: commonLib.getLanguagePropertyDataTableNet(null, null)
    });

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,318Questions: 26Answers: 4,948
    Answer ✓

    Start by changing serverside: true, to serverSide: true,. Notice the S. The options are case sensitive.

    Kevin

  • Gilles BouchardGilles Bouchard Posts: 4Questions: 2Answers: 0

    How silly of me! That was it! Thanks

Sign In or Register to comment.