So I want to use Datatables.js to have a nice UI, at the back end I make a database query and produce json, but Datatables isn't happy, I think my json is to blame
my @rows = $dbh->selectall_arrayref($sql, {Slice => {}});
my $cont = {data => \@rows};
$c->render(json => $cont);
My 'json' looks like:
{"data": [[
{
"UNAME": "Name Goes Here",
"AGE": "Age goes here",
"TITLE": "Title goes here"
},
more results int he same format
]]}
Datatables says "Datatables warning: table id=example - Requested unknown parameter "UNAME" for row 0, col 0. I think my json is badly formed