DataTables warning (table id = 'myTable'): Requested unknown parameter '0' from the data source for row 0
19663 단어 datatables
<table id="myTable">
<thead>
<tr>
<th>Title-1</th>
<th>Title-2</th>
<th>Title-3</th>
<th>Title-4</th>
<th>Title-5</th>
<th>Title-6</th>
<th>Title-7</th>
<th>Title-8</th>
<th>Title-9</th>
<th>Title-10</th>
<th>Title-11</th>
<th>Title-12</th>
......
</tr>
</thead>
<tbody></tbody>
</table>
Javascript:
<script type="text/javascript">
$(function () {
$('#myTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/TodaySO",
"bPaginage": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 5,
"oLanguage": { "sUrl": "/Scripts/DataTable/dataTable_cn.txt" }//
// !
});//end table
});//end ready()
</script>
Controller:
var result = from f in filteredData.OrderBy(o => o.SalesOrder)
.Skip(param.iDisplayStart)
.Take(param.iDisplayLength)
.ToList()
select new[]{ f.Field-1, f.Field-2, f.Field-3, f.Field-4, f.Field-5, f.Field-6, f.Field-7, f.Field-8, f.Field-9, f.Field-10, f.Field-11, f.Field-12
......
};
---------------FireBug------------
배열 형식:
{"sEcho":"1","iTotalRecords":2210,"iTotalDisplayRecords":2210,
"aaData":[
["3004582952","10 "],
["3004582952","100 "],
["3004582952","20 "],
["3004582952","30 "],
["3004582952","40 "]
]
}
두 번 째 방법: js 에 Html 을 설정 합 니 다.
<table id="myTable">
<thead>
<tr>
<th>Title-1</th>
<th>Title-2</th>
<th>Title-3</th>
<th>Title-4</th>
<th>Title-5</th>
<th>Title-6</th>
<th>Title-7</th>
<th>Title-8</th>
<th>Title-9</th>
<th>Title-10</th>
<th>Title-11</th>
<th>Title-12</th>
......
</tr>
</thead>
<tbody></tbody>
</table>
Javascript:
<script type="text/javascript">
$(function () {
$('#myTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/TodaySO",
"bPaginage": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 5,
"oLanguage": { "sUrl": "/Scripts/DataTable/dataTable_cn.txt" },//
"aoColumns": [ { "mData": "Field-1" }, { "mData": "Field-2" }, { "mData": "Field-3" }, { "mData": "Field-4" } , { "mData": "Field-5" } , { "mData": "Field-6" } , { "mData": "Field-7" } , { "mData": "Field-8" } , { "mData": "Field-9" } , { "mData": "Field-10" } , { "mData": "Field-11" } , { "mData": "Field-12" } ......
]
});//end table
});//end ready()
</script>
Controller:
var result = from f in filteredData
.OrderBy(o => o.SalesOrder)
.Skip(param.iDisplayStart)
.Take(param.iDisplayLength)
select f;
---------------FireBug------------
Javascript 개체 형식:
{
"sEcho":"1",
"iTotalRecords":2210,
"iTotalDisplayRecords":2210,
"aaData":[
{"SalesOrder":"3004582952","SalesOrderItem":"10 ","CustomerPO":"SEG131800",...},
{"SalesOrder":"3004582952","SalesOrderItem":"100 ","CustomerPO":"SEG131801",...},
{"SalesOrder":"3004582952","SalesOrderItem":"20 ","CustomerPO":"SEG131802",...},
{"SalesOrder":"3004582952","SalesOrderItem":"30 ","CustomerPO":"SEG131803",...},
{"SalesOrder":"3004582952","SalesOrderItem":"40 ","CustomerPO":"SEG131804",...}
]
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
데이터tables 사용자 정의 이상 처리alert 알림을 닫고 컨트롤러 출력 오류로 변경 공식 설명$.fn.dataTable.ext.errMode 설정DataTables 검출된 오류를 어떻게 알릴 것인가...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.