My web api works fine.But datatable shows "no data available in table".I have attached the script.
My web api works fine.But datatable shows "no data available in table".I have attached the script.
$(document).ready(function () {
$('#tblEmployee').DataTable(
{
ajax: {
"url": "http://localhost:57507/api/Employee/Get",
"dataSrc": ""
}
,
columns : [
{ data: 'Employee_Id' },
{ data: 'Project_Id' },
{ data: 'Grade_Id' },
{ data: 'Site_Id' },
{ data: 'Location_Id' },
{ data: 'StartDate' },
{ data: 'EndDate' },
{ data: 'BillRate' },
{ data: 'Role' },
]
}
);
});
Answers
We would need to be able to see an example of what your API is returning. From the above it should be:
Allan