I'm trying to parse a JSON object I'm making in Python and populate it in Datatables using ajax. It's not parsing the data into the columns but I suspect it could be because of my JSON structure since it doesn't have the "data" header object? Am I accessing the data correcting in my ajax ?
Here's my AJAX section
$(document).ready(function() {
$.fn.dataTable.ext.errMode = 'none';
var table = $('#ce_table').DataTable( {
"processing": true,
"ajax": "/api/1.0/agents",
"columns": [
{ "data": "machine.hostname" },
{ "data": "machine.epm" }
]
} );
});
This is what my data structure looks like
[
{
"machine": {
"hostame": "machine0101",
"epm": "0"
}
},
{
"machine": {
"hostame": "machine0202",
"epm": "1"
}
}
]