Issue when using fnrender with ajax data

Issue when using fnrender with ajax data

jigarshahjigarshah Posts: 5Questions: 0Answers: 0
edited June 2012 in General
[code]
var myTable = $('.my-datatable').dataTable( {
"bProcessing": false,
"sAjaxSource": "../../services/rs/customMy/listMy/ACTIVE",
sPaginationType: "full_numbers",
sAjaxDataProp : "",
bSortClasses: false,
"sRowSelect": "single",
"aoColumns": [
{ "fnRender" : function (o) {
return '';
}},
{ "mDataProp": "name" },
{ "mDataProp": "displayDate" },
{ "mDataProp": "status" }
]
});
[/code]
Ajax Data is
[code]
[{"name":"New","id":3051,"status":"ACTIVE","displayDate":"06/27/2012","logoFile":{"id":3001,"fileName":"IMG.jpg"}, "logoId":null,"displayStyle":"GR"}]
[/code]

table definition
[code]



Icon
My Name
Created
Status





[/code]

I am getting alert as
DataTables warning (table id = 'DataTables_Table_0'): Requested unknown parameter '0' from the data source for row 0

But surprisingly, table renders correctly.
What I am missing here ?

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    This question comes up fairly often, so I've just added an FAQ about it: http://datatables.net/faqs#unknown_parameter_fnRender . Let me know if that answers your question :-)

    Allan
This discussion has been closed.