"Unknown parameter" issue due to (apparently) unidentified mData property
"Unknown parameter" issue due to (apparently) unidentified mData property
andrew_chizhik
Posts: 2Questions: 0Answers: 0
Hi! I'm building a DataTable that pulls in data from an AJAX call, and unfortunately, I'm facing the (apparently common) "unknown parameter" issue. Specifically, here's the error message I'm getting:
"DataTables warning (table id = 'accountAssigner_brandShareTable'): Requested unknown parameter '0' from the data source for row 0"
I've found many posts on the forum dealing with this same error, but none of them had an answer that fit my scenario.
Here's my debugger output: http://debug.datatables.net/osegud
When I expand the "Columns" section, I see that the "mData" property for each column appears to be "undefined", which I imagine is the source of the problem. I'm not sure why it's undefined, though, since - as far as I can tell - my DataTable declaration is pretty straightforward:
[code]
$('#accountAssigner_brandShareTable').dataTable(
{
"bProcessing": true,
"bDestroy": true,
"bFilter": false,
"bSort": false,
"bPaginate": false,
"sAjaxSource": "<%= Page.ResolveClientUrl("ajax/account-assigner-get-share.ashx") %>",
"fnServerParams": function ( aoData )
{
aoData.push( { "name": "companyId", "value": brandId } );
},
"sAjaxDataProp": "Data",
"aoColumnDefs": [
{ "aTargets": [0], "mData": "UserId"},
{ "aTargets": [1], "mData": "UserName" },
{ "aTargets": [2], "mData": "PercentShare" }
],
"fnInitComplete": accountAssigner.loadModal
});
[/code]
Seems like "mData" is defined for every column. I'm not really sure what to think of this. I'd really appreciate any advice anyone might have!
(If there's any more data that I should provide, please let me know.)
"DataTables warning (table id = 'accountAssigner_brandShareTable'): Requested unknown parameter '0' from the data source for row 0"
I've found many posts on the forum dealing with this same error, but none of them had an answer that fit my scenario.
Here's my debugger output: http://debug.datatables.net/osegud
When I expand the "Columns" section, I see that the "mData" property for each column appears to be "undefined", which I imagine is the source of the problem. I'm not sure why it's undefined, though, since - as far as I can tell - my DataTable declaration is pretty straightforward:
[code]
$('#accountAssigner_brandShareTable').dataTable(
{
"bProcessing": true,
"bDestroy": true,
"bFilter": false,
"bSort": false,
"bPaginate": false,
"sAjaxSource": "<%= Page.ResolveClientUrl("ajax/account-assigner-get-share.ashx") %>",
"fnServerParams": function ( aoData )
{
aoData.push( { "name": "companyId", "value": brandId } );
},
"sAjaxDataProp": "Data",
"aoColumnDefs": [
{ "aTargets": [0], "mData": "UserId"},
{ "aTargets": [1], "mData": "UserName" },
{ "aTargets": [2], "mData": "PercentShare" }
],
"fnInitComplete": accountAssigner.loadModal
});
[/code]
Seems like "mData" is defined for every column. I'm not really sure what to think of this. I'd really appreciate any advice anyone might have!
(If there's any more data that I should provide, please let me know.)
This discussion has been closed.
Replies
Allan
(And thank you for DataTables, too; it's absolutely fantastic.)