I'm having a bizarre problem getting my hair ripped, I know I'm creating a valid json via server side, even using a json validator. the format of my json is this way:
[
{
"name": "jhon doe",
"age": "22",
"eye": "brown"
},
{
"name": "amanda",
"age": "26",
"eye": "blond"
}
]
When instantiating the datatables, it brings me all the results all at once. not page, and the option of filtering so that there are only 10 results at a time also does not work. here's my javascript code:
$('#list_table').DataTable({
processing: true,
serverSide: true,
language: language,
ajax: {
url: 'myurl.dev/fetchdata',
dataType: 'json',
dataSrc: ''
},
columns: [
{ data: "name" },
{ data: "age" },
{ data: "eye" }
],
responsive: true,
autoWidth: false,
order: [0, 'desc'],
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
When checking the network tab - > XHR. I see the answer brings me the result like this:
What else can I do to make it work correctly? it's the first time I'm dealing with this problem using datatables.