Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82134

Help Needed with DataTable JSon

$
0
0
Hi All, could someone help me with the following issue. when the data table loads I get the following error. Below is the Html, Javascript and json data source.

---------------------------
Message from webpage
---------------------------
DataTables warning (table id = 'ProjectItemsDataTable'): Requested unknown parameter '0' from the data source for row 0
---------------------------
OK
---------------------------

The HTML is

<table id="ProjectItemsDataTable">
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Owner
</th>
<th>
Closed On
</th>
<th>
Due Date
</th>
</tr>
</thead>
<tbody>
</tbody>

</table>


The datatable set up is as follows

$('#ProjectItemsDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": "ProjectItem/ProjectItemsDataTableAjaxHandler",
"bProcessing": true,
"aoColumns": [
{"sName": "Name" },
{ "sName": "Type" },
{ "sName": "Owner" },
{ "sName": "ClosedOn" },
{ "sName": "DueDate" }
]
});




The JSon posted back to the datatable is
{
"sEcho":"1",
"iTotalRecords":14,
"iTotalDisplayRecords":14,
"aaData":[
{
"Name":"t",
"Type":"t",
"Owner":"qq",
"ClosedOn":"\/Date(1340985600000)\/",
"DueDate":"\/Date(1340985600000)\/"
},
{
"Name":"21",
"Type":"Bug",
"Owner":"tes",
"ClosedOn":"\/Date(1362499200000)\/",
"DueDate":"\/Date(1384444800000)\/"
},
{
"Name":"tt",
"Type":"Bug",
"Owner":"tt",
"ClosedOn":"\/Date(1364572800000)\/",
"DueDate":"\/Date(1364659200000)\/"
},
{
"Name":"p1",
"Type":"p1",
"Owner":"p1",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"aaa",
"Type":"aaa",
"Owner":"aaa",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"qq",
"Type":"qq",
"Owner":"qq",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"qq",
"Type":"qq",
"Owner":"qq",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"qq",
"Type":"qq",
"Owner":"qq",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"qq",
"Type":"qq",
"Owner":"qq",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"dddddd",
"Type":"dddddd",
"Owner":"dddddd",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"aa",
"Type":"aa",
"Owner":"aa",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"aa",
"Type":"aa",
"Owner":"qqqqqqq",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"qq",
"Type":"Action",
"Owner":"qqqqqqq",
"ClosedOn":null,
"DueDate":null
},
{
"Name":"1234",
"Type":"Bug",
"Owner":"qqwfdfddd",
"ClosedOn":null,
"DueDate":null
}
]
}

Viewing all articles
Browse latest Browse all 82134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>