Hi, i have json response from my api, and i validate it in jsonlint, but datatable always return TypeError: undefined is not an object (evaluating 'data.length'). Here how i load datatable:
mTable = $('#tmesa').DataTable( {
'sDom': 'T<"clear">lfrtip',
'bSort': false,
'bFilter': false,
'language': {
select: {
rows: " "
},
"infoEmpty": "No hay mesas para local",
"emptyTable": " ",
"loadingRecords": ' ',
"processing": ' ',
"info": "Total filas: ",
"infoFiltered": ""
},
'scrollY': "325px",
'fnRowCallback': function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
},
'processing': true,
'paging': false,
'serverSide': true,
'ajax': {
"url" : "https://168.14.1.42:8443/descenariom/08204",
"type": "GET",
"data": function ( d ) {
return $.extend( {}, d, {
"id" : codigoLocal
})
}
},
'columns': [
{ data : "glosamesafusionada" },
{ data : "destino_fecha" },
{ data : "destino_digita_fecha" }
],
'bAutoWidth': false,
'responsive': true,
'aoColumns' : [
{ sWidth: '33%' },
{ sWidth: '33%' },
{ sWidth: '33%' }
],
'columnDefs':[
{ targets: [0, 1], className: 'dt-body-left' },
{ targets: [2], className: 'dt-body-center' }
],
'drawCallback': function( settings ) {
console.log('listo...');
}
});
Thanks!!!!