Requested unknown parameter 'status' for row 0
Requested unknown parameter 'status' for row 0
nateha1984
Posts: 2Questions: 1Answers: 0
I'm trying to load a table through ajax and am getting that cryptic error message. The data does seem to load correctly, but there are 4 blank rows that load before the data does. Here's my code:
$('#testTable').DataTable({
"paging": true,
"lengthChange": false,
"info": false,
"data": "data",
"ajax": "http://localhost:8888/data/claims.json",
"columns" : [
{"data": "status"},
{"data": "priority"},
{"data": "date_of_claim"},
{"data": "code"},
{"data": "name"},
{"data": "file"},
{"data": "team"},
{"data": "flash"},
{"data": "assigned_to"},
{"data": "claim_status"},
{"data": "assigned_lane"}
]
});
And the json response:
{
"data": [
{
"status": "New Mail",
"priority": "High",
"date_of_claim": "5/1/2015",
"code": "010",
"name": "Bunny, Bugs",
"file": "123123123123",
"Team": "A Team",
"flash": "",
"assigned_to": "User 1",
"claim_status": "RFD",
"assigned_lane": "1"
},
{
"status": "Pending Scanning",
"priority": "Low",
"date_of_claim": "2/13/2015",
"code": "010",
"name": "Duck, Daffy",
"file": "612801212",
"Team": "B Team",
"flash": "",
"assigned_to": "User 2",
"claim_status": "RFD",
"assigned_lane": "2"
},
{
"status": "New Mail",
"priority": "Low",
"date_of_claim": "5/12/2015",
"code": "020",
"name": "Bunny, Bugs",
"file": "987987986",
"Team": "A Team",
"flash": "Documents exist",
"assigned_to": "User 1",
"claim_status": "Cancelled",
"assigned_lane": "4"
},
{
"status": "New Mail",
"priority": "High",
"date_of_claim": "5/4/2015",
"code": "010",
"name": "Bunny, Bugs",
"file": "67000871",
"Team": "C Team",
"flash": "Dangerous",
"assigned_to": "User 3",
"claim_status": "Open",
"assigned_lane": "1"
}
]
}
And finally the HTML:
<table id="testTable" class="table">
<thead>
<tr>
<th>Status</th>
<th>Priority</th>
<th>Date of Claim</th>
<th>Code</th>
<th>Name</th>
<th>File Number</th>
<th>Team</th>
<th>Flash</th>
<th>Assigned To</th>
<th>Claim Level Status</th>
<th>Assigned Lane</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
Any help would be appreciated, thanks!!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Remove that. You are passing in a string to the
data
option (it should be an array if you pass it in at all - but if you are Ajax loading the data, you don't need to set it at all).Allan
That did it, thanks for the help!