ServerSide Datatables lengthmenu not working correctly

ServerSide Datatables lengthmenu not working correctly

amitozamitoz Posts: 1Questions: 1Answers: 0

What I would like to get working is the "lengthMenu": [ [10, 25, 100, 500], [10, 25, 100, 500] ] and I'm using ServerSide in datatables. Option 10, 25 and 100 are working but when I select 500 it gives me an error saying "No data found in server"/"DataTables warning: table id=crm-table - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1".
I try to fix the issue as suggested by the link above, but chrome don't let me see the ajax data.

"processing": true,
"serverSide": true,
"lengthMenu": [[10, 25, 50, 159, 500, -1], [10, 25, 50, 159, 500, "All"]],
"deferRender": true,
"scrollX": true,
"ajax":{
url :"server-side-CRM.php", // json datasource
type: "post", // method , by default get
// error: function(){ // error handling
// $(".crm-table-error").html("");
// $("#crm-table").append('<tbody class="crm-table-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
// $("#crm-table_processing").css("display","none");
// }
},

Answers

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin

    Sounds like the server side code isn't coping when 500 is being sent to the server. If there is no response data shown in Chrome, it is likely an error has occurred on the server-side - probably out of memory.

    I would suggest, in the first instance, that you take a look at your server's error logs to see if any errors are reported.

    Allan

This discussion has been closed.