Index column reverse order
Index column reverse order
varus14
Posts: 1Questions: 1Answers: 0
I have this code:
var t = $('#plasa_orizontala').DataTable( {
dom: "Bfrtip",
order: [[ 4, "desc" ]],
ajax: {
url: "ajax/plasa-orizontala.php",
type: "POST"
},
columns: [
{ data: null },
{ data: "nume" },
{ data: "albmaro" },
{ data: "foliate" },
{ data: "plasa" },
{ data: "pret" }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor}
]
} );
t.on( 'order.dt search.dt', function () {
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
cell.innerHTML = i+1;
} );
} ).draw();
The index column is ok but i want to start descending order
not 1, 2, 3, 4... 900
i want if i have 900 records to start 900, 899, 898, 897.... 1
any help is apreciated
if u have solution for server side it would be better
This discussion has been closed.