0
我正在成功地從服務器獲取JSON對象。但是當我使用,以顯示與jQuery的數據表中的數據,它顯示了這個警告:DataTables警告:表id = StudentTable - 針對第0行,第0列請求未知參數「0」
數據表警告:表ID = StudentTable - 請求的未知參數「0」 0行,列0
當我點擊確定,然後顯示沒有數據的行。我該如何解決這個問題?
下面是代碼
@section scripts{
<script type="text/javascript">
$(document).ready(function() {
$("#StudentTable").dataTable({
ajax: {
url: "/Students/GetAllStudents",
type: "POST",
dataType: "JSON"
},
serverSide: "true",
processing:"true",
column: [
{
data: "StudentName"
},
{
data: "Registration"
},
{
data: "DeptName"
},
{
data: "Email"
},
{
data: "Date"
},
{
data: "Seasson"
},
{
data: "Address"
},
{
data: "ContactNo"
},
{
render:function(data, type, students) {
return "<a href='/Students/edit/" + students.StudentId + "'> Edit</a>";
}
}
]
});
});
</script>
}
<table id="StudentTable" class="table">
<thead>
<tr>
<th>Student Name</th>
<th>Reg No</th>
<th>Department</th>
<th>Email</th>
<th>Date</th>
<th>Seasson</th>
<th>Address</th>
<th>Contact No</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table>
謝謝@ Gyrocode.com 該問題現已解決。 –