I'm trying to render some data that i get with ajax into a datatable, but it seems I'm missing something, because it displays the error: TypeError: c is undefined.
I've read this post, Datatables TypeError: c is undefined, but any solution given hasn't solved my problem. Anyone have an idea that could help me? Thank you.
html code:
<table id="itinerariDetailTable" class="table table-sm table-striped table-bordered" style="font-size: x-small;">
<thead class="thead-inverse">
<tr>
<th>Id</th>
<th>Codi</th>
<th>Descripció</th>
<th>Temporada</th>
<th>Districte</th>
<th>Barri</th>
<th>C. Treball</th>
<th>G. Servei</th>
<th>T. Servei</th>
<th>Máquina</th>
<th>Corretorn</th>
<th>Torn</th>
<th>Tipus Día</th>
<th>Equips</th>
<!-- <th>Jornades</th>
<th>Cost unitari</th>
<th>T. Itinerari</th>
<th>Escenario</th> -->
</tr>
</thead>
<tfoot>
<tr>
<th>Id</th>
<th>Codi</th>
<th>Descripció</th>
<th>Temporada</th>
<th>Districte</th>
<th>Barri</th>
<th>C. Treball</th>
<th>G. Servei</th>
<th>T. Servei</th>
<th>Máquina</th>
<th>Corretorn</th>
<th>Torn</th>
<th>Tipus Día</th>
<th>Equips</th>
<!-- <th>Jornades</th>
<th>Cost unitari</th>
<th>T. Itinerari</th>
<th>Escenario</th> -->
</tr>
</tfoot>
</table>
js code:
$('#itinerariDetailTable').DataTable( {
"processing": true,
"serverSide": true,
"ajax":{
"url":'/escenaris/selectById',
"type":'GET',
"data": function(d){
d.idEscenari = $('#idEscenari').val();
}
},
"order": [[ 0, "asc" ]],
"columns": [
{ "data": "idItinerari" },
{ "data": "codiItinerari" },
{ "data": "descripcio" },
{ "data": "temporada.codiTemporada" },
{ "data": "districte" },
{ "data": "barri" },
{ "data": "centreTreball" },
{ "data": "grupServei" },
{ "data": "tractamentRecursos" },
{ "data": "maquinaCombustible" },
{ "data": "corretorn" },
{ "data": "torn" },
{ "data": "tipusDia" },
{ "data": "nombreEquips" }
/*{ "data": "frequencia" },
{"data": "resultatItinerari.costUnitari", "defaultContent": "0" },
{ "data": "tipusItinerari.codiTipusItinerari" }/*,
{ "data": "escenari.idEscenari" } */
]
});