fnRender error in 1.9.3

fnRender error in 1.9.3

prubinprubin Posts: 26Questions: 0Answers: 0
edited September 2012 in General
I recently upgraded to 1.9.3 and started getting this error: DataTables warning (table id = 'Forecast'): Requested unknown parameter '2' from the data source for row 0.

I only get this error on the very first row, it occurs before the render function is called and after the description column has been added to the celldata.

[code]
'aoColumns': [
{ 'mDataProp': 'dateText' },
{ 'mDataProp': 'desciption' },
{ 'mDataProp': null, fnRender : function(o, val) { return ""; }, 'bSortable': false, 'bSearchable': false },
{ 'mDataProp': 'probabilityOfPrecipiation.daytime' },
{ 'mDataProp': 'temperatures.daytimeHigh' }
],
[/code]

What am I doing wrong?

PS: How do I stop the link around fnRender function?

Replies

  • prubinprubin Posts: 26Questions: 0Answers: 0
    OK so I have been trying to figure this out. It seems that the problem is both the val parameter and the mDataProp value. Even when the mDataProp is set to null, it still tries to retrieve it. If I do not define it it still give the error:

    [code]
    'aoColumns': [
    { 'mDataProp': 'dateText' },
    { 'mDataProp': 'desciption' },
    { fnRender : function(o, val) {
    return "";
    },
    'bSortable': false, 'bSearchable': false
    },
    { 'mDataProp': 'probabilityOfPrecipiation.daytime' },
    { 'mDataProp': 'temperatures.daytimeHigh' }
    ],
    [/code]

    But if I define it as a valid value then the error goes away and the val parameter to render contains the value of that attribute:

    [code]
    'aoColumns': [
    { 'mDataProp': 'dateText' },
    { 'mDataProp': 'desciption' },
    { 'mDataProp': 'web.pictureURL',
    fnRender : function(o, val) {
    return "";
    },
    'bSortable': false, 'bSearchable': false
    },
    { 'mDataProp': 'probabilityOfPrecipiation.daytime' },
    { 'mDataProp': 'temperatures.daytimeHigh' }
    ],
    [/code]
  • prubinprubin Posts: 26Questions: 0Answers: 0
    change mDataProp to mData and the problem vanishes
This discussion has been closed.