Why isn't this SS JSON rendering?
Why isn't this SS JSON rendering?
Trying to render a simple table with server side JSON data.
Here is the table:
First name | Last name |
---|---|
First name | Last name |
here is the init code:
<script type="text/javascript">
$('#member_list').DataTable(
serverSide: true,
ajax: 'http://localhost:5000/Member/GetMemberList',
columns: [
{ data: "firstName" 'type' : 'string' },
{ data: "lastName", 'type' : 'string' }
]
);
</script>
and here is the json data beind fed by that url
{
"draw": 1,
"recordsTotal": 1,
"recordsFiltered": 1,
"data": [{
"memberId": 6229,
"associationId": 1,
"association": null,
"siteUserId": null,
"dateJoined": null,
"dateLeft": null,
"active": true,
"balance": 0.0,
"firstName": "Wayne",
"lastName": "Howard",
"nickName": "Melon"
}]
}
And for some reason it does nothing. I have verified that the right files are included. If I simply do this:
$('#member_list').DataTable();
the table is rendered as an empty datatables table.
This question has an accepted answers - jump to answer
Answers
Nevermind. Being stupid.