Issue when using fnrender with ajax data
Issue when using fnrender with ajax data
[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 ?
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 ?
This discussion has been closed.
Replies
Allan