0
Good morning wanted to sort a datatable of Angular JS by a column that is a timestamp of descending form and for that I used:
controllerScope.logsData = {
ajax: {
url: '/api/organizations/'+$rootScope.organization.id+'/alerts?type=logevent',
dataSrc: '',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", AuthService.authToken());
}
},
columns: [
{"data":"timestamp", render: function(data,type,row){
return $filter('date')(row.timestamp, 'dd-MM-yyyy HH:mm:ss');
}},
{"data":"data.serial","defaultContent":""},
{"data":"data.type","defaultContent":""},
{"data":null, "orderable":false, "render":function(data){
if(data.data.body){
return JSON.stringify(data.data.body);
} else {
return '';
}
}}
],
order: [[0, 'desc']]
However this ordination is not working... Can anyone help?
Thank you I’ve already solved
– Catia Matos