Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

mRender gives error

$
0
0
Hey

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

"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"
    }
], 

If I uncomment this line:
{# "mRender": function ( data, type, row ) { return data; },#}
It gives me this error:

DataTables warning (table id = 'DataTables_Table_0'): Requested unknown parameter '1' from the data source for row 0

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

Viewing all articles
Browse latest Browse all 1816

Trending Articles