"No data available in table" is the output my datatable shows
"No data available in table" is the output my datatable shows
This is my UI.
**<html>
<head>
<title>DataTable</title>
<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css"/>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('#tblEmployee').DataTable(
{
ajax: {
"url": "http://localhost:57507/api/Employee/Get"
}
,
columns: [
{ data: 'Employee_Id' },
{ data: 'Project_Id' },
{ data: 'Grade_Id' },
{ data: 'Site_Id' },
{ data: 'Location_Id' },
{ data: 'StartDate' },
{ data: 'EndDate' },
{ data: 'BillRate' },
{ data: 'Role' },
] } ); });</script>
</head>
<body>
<form id="form1" runat="server"> <table id="tblEmployee">
<thead>
<tr>
<th>Employee ID</th>
<th>Project ID</th>
<th>Grade ID</th>
<th>Site ID</th>
<th>Location ID</th>
<th>Start Date</th>
<th>End Date</th>
<th>Bill Rate</th>
<th>Role</th>
</tr>
</thead>
</table> </form>
</body>
</html>
**
I have attached the output of my Web api:
Answers
Happy to take a link at the page if you post a link.
Also note that you are using a very old version of DataTables which doesn't support the parameters you are using. Camel case notation was added in 1.10. I'd suggest you use 1.10.13 which is the current release.
Allan