No parameter return to the server
No parameter return to the server
Gilles Bouchard
Posts: 4Questions: 2Answers: 0
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
Start by changing
serverside: true,
toserverSide: true,
. Notice theS
. The options are case sensitive.Kevin
How silly of me! That was it! Thanks