"Unknown parameter" issue due to (apparently) unidentified mData property

"Unknown parameter" issue due to (apparently) unidentified mData property

andrew_chizhikandrew_chizhik Posts: 2Questions: 0Answers: 0
edited February 2013 in General
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.)

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    mData is new in 1.9.4. Previously it was called mDataProp - and you are using an old version of DataTables.

    Allan
  • andrew_chizhikandrew_chizhik Posts: 2Questions: 0Answers: 0
    Boy, is my face red. Thank you so much, Allan!

    (And thank you for DataTables, too; it's absolutely fantastic.)
This discussion has been closed.