Requested unknown parameter '0' for row 0 Ajax and JSON
Requested unknown parameter '0' for row 0 Ajax and JSON
jialero
Posts: 1Questions: 1Answers: 0
I'm new to datatables and I'm stuck with this error: Requested unknown parameter '0' for row 0.
This is my code:
Javascript
var table = $('#myTable').DataTable({
"bPaginate": false,
"bInfo": false,
"bFilter": true,
"bProcessing" : true,
"bServerSide": true,
"ajax" : {
"url" : '/guild/public/filltable',
"type" : 'POST',
"data": {
"fechaInicio": $('#datepicker1').val(),
"fechaFin" : $('#datepicker2').val(),
"_token" : $('input[name=_token]').val(),
"dataSrc": "data"
},
"columns": [
{ "data": "code" },
{ "data": "name" },
{ "data": "price" },
{ "data": "rend" },
{ "data": "launch" },
{ "data": "risk" },
{ "data": "disp" },
{ "data": "currency" }
]
},
});
HTML
<table class="ui celled table" id="myTable">
<thead>
<tr>
<th>Code</th>
<th>Name<th>
<th>Price</th>
<th>Rendto(%)</th>
<th>Launch</th>
<th>Risk</th>
<th>Disp</th>
<th>Currency</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
JSON Response
{"data":[{"code":"98174","name":"OMI IM USD Man AHL Trend","price":1.104,"rend":"-3.916","launch":"2012-05-18","risk":5,"disp":"Disp","currency":"EUR"}]}
I really don't know what to do about it, I searched many things but most of the answers were outdated. Thanks for your time.
This discussion has been closed.