I am using datable to sort my table of a column called rank. Now my rank is represented as integer (1-4) in the database. So for example, I have rank 1 that is Bronze, rank 2 that is Silver, rank 3 that is Gold and rank 4 that is Platinum. The highest rank is platinum. So I want it to display on the table that shows the order from highest rank to lowest.
On my script I would write something like below:
$("#report").DataTable({
"searching": false,
"pageLength": 25,
"processing": true,
"order": [2, 'desc'],
dom: "lBfrtip"
});
This would not display in the right order as the datatable is sorting the column based on alphabetically. So my column will output the order like:
Silver
Platinum
Gold
Bronze
I want it to be:
Platinum
Gold
Silver
Bronze
Is it possible to modify this to make it to work (without modifying the server side script)?