My datatable shows "No data available in table"
My datatable shows "No data available in table"
piyu12345
Posts: 3Questions: 3Answers: 0
'''<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleDataTable.aspx.cs" Inherits="DataTableExample.SampleDataTable" %>
<!DOCTYPE html>
<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 () {
var url = 'http://localhost:57507/api/Employee/Get';
var table = $('#tblEmployee').DataTable({
'processing': true,
'serverSide': true,
'ajax': {
'url': url,
'data': function (d) {
console.log(d.order);
return JSON.stringify(d);
}
},
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">
Employee ID | Project ID | Grade ID | Site ID | Location ID | Start Date | End Date | Bill Rate | Role |
---|
</form>
</body>
</html>'''
This discussion has been closed.
Answers
Allan already answered your other post. Please don't post duplicates, it doesn't help.