How can I order by descending

How can I order by descending

polachanpolachan Posts: 101Questions: 50Answers: 0

I am creating the datatable using the code given below but the sorting order by desc is not working please hlep how to give the order the column //order: [[8, 'desc']],
table = $('#MeterArea').DataTable({
"processing": true,
"ajax": {
"type": "GET",
"url": url,
"datatype": "json",
"dataSrc": function (json) {
return JSON.parse(json);
}
},
"columns": [
{ "data":'Id'},
{ "data": 'DepotNo' },
{ "data": 'DepotName' },
{ "data": 'MeterCode' },
{ "data": 'ReadingYear' },
{ "data": 'ReadingMonth' },
{ "data": 'ReadingtxtDate' },
{ "data": 'Reading' }
{ "data": 'ReadingDate' }
],
//order: [[8, 'desc']],
"pageLength": 40,
scrollY: "400px",
scrollX: true,
paging: true,
dom: 'Bfrtip',
buttons: [
'copy',
'csv',
'excel',
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL'
}

         ]

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.