mRender gives error

mRender gives error

DorDor Posts: 2Questions: 0Answers: 0
edited January 2014 in DataTables 1.9
Hey

This is my code in Twig using datatables.
It works only if one line is commented as below (twig comment {# ... #} )

[code]
"bProcessing": true,"bServerSide": true,
"sAjaxSource": "{{ path('table_data') }}",
"aoColumnDefs": [
{
"aTargets": [ 0 ],
"mData": "document.documentNumber"
}
,{
{# "mRender": function ( data, type, row ) { return data; },#}
"aTargets": [ 1 ],
"mData": "document.netSum"
}
,{
"aTargets": [ 2 ],
"mData": "document.grossSum"
}
],
[/code]

If I uncomment this line:
[code]
{# "mRender": function ( data, type, row ) { return data; },#}
[/code]
It gives me this error:
[quote]
DataTables warning (table id = 'DataTables_Table_0'): Requested unknown parameter '1' from the data source for row 0
[/quote]

I have no idea why this fails, I tried to follow mRender documentation from here http://datatables.net/usage/columns
On this stage, I would like to print whatever in mRender function, this "data" is just an example.

PS: I don't know if its important, but I use datatables indirectly by CSS template http://themeforest.net/item/melon-flat-responsive-admin-template/5495486

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    That does look like it should work. Can you link to a test page showing the problem so I can debug it please.

    Allan
  • DorDor Posts: 2Questions: 0Answers: 0
    Thank you Allan for quick answer, I will try to supply test page soon.
This discussion has been closed.