I can't able to get data from ajax.

I can't able to get data from ajax.

mohaideenmohaideen Posts: 10Questions: 3Answers: 0
edited December 2014 in Free community support

I am using getting the datat from ajax
'''
DataTableApp = $('#deviceRoleTable').dataTable({
"sAjaxSource": api.GET_ROLES,
//"ajax": api.GET_ROLES,
"bRetrieve": true,
"bServerSide": true,
//"sAjaxDataProp": "aaData",
"sServerMethod": "GET",
"oLanguage": {
"sZeroRecords": "No records to displays",
"sEmptyTable": "No data available in table"
},
"fnInitComplete": function(oSettings, json) {
console.log(json);
//$('#loader').hide();
},
"fnServerParams": function(aoData) {
console.log(aoData);
},
"mDataProp": null,
"aoColumns": [
{
"sTitle":"Role ID",
"mData": "id",
"aTargets":[0],
"mRender": function(data, type, row) {
console.log(row);
return '<span class="appName">' + row.id + '</span>';
}
}, {
"sTitle":"Role Name",
"mData": "roleName"
}, {
"sTitle":"Action",
"mData": "roleName"
}]
}); '''

In Response, I have so many datas. But I have to show id, roleName and customized column.

Here I am getting "Uncaught TypeError: Cannot read property 'length' of undefined" Error

This discussion has been closed.