Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81989

Json format - sAjaxDataProp

$
0
0

Can you help me.




<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">

Calling Ajax:
var table = $('#listRoles').dataTable({
"sAjaxSource": "${pageContext.request.contextPath}/api/roles",
"sAjaxDataProp": "",
"aoColumns": [
{ "mdata": "roleName"},
{ "mdata": "createdBy"},
{ "mdata": "dateTime"},
{ "mdata": "description"}
]

})

Result
{
"JSON": [
{
"id": 3,
"roleName": "ROLE_ADMIN",
"description": "Administrator",
"dateTime": 1581973182899,
"createdBy": "testuser"

    },
    {
        "id": 5,
        "roleName": "ROLE_DEV",
        "description": "Role for all DEV",
        "dateTime": 1582186318000,
        "createdBy": "cicero.nogueira@ecrscorp.com"
    },
    {
        "id": 1,
        "roleName": "ROLE_EMPLOYEE",
        "description": "Any employee",
        "dateTime": 1581973182899,
        "createdBy": "testuser"
    }
]

}
ERROR : TypeError: d is undefined
Page loading.
What is wrong?


Viewing all articles
Browse latest Browse all 81989

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>