How do I sort by Date and Status type ?

How do I sort by Date and Status type ?

SakifabuSakifabu Posts: 1Questions: 1Answers: 0

I have been trying to Sort the table by two columns one by date time which i can do by using the order attribute but the other is by status which is proving to be a bit more difficult. This is what I have so far
$(document).ready(function () {
var table = $("#RequestDetSubmittedReq").DataTable({
responsive: true,
//paging: true,

   fixedColumns: true,
   ordering: true,
   columnDefs: [
       {
           width: '20%', targets: 0
       },
       {
           targets: [5],
           orderData: [5, 6]
       },
       {
           targets: [6],
           orderData: [5, 6]
       }

   ],
   "order":[[5, "desc"],[6,"asc"]],
    "language":
        {
            "emptyTable": "There are currently no submitted request"
        }             
});

});
The Data Consists of one of these (Pending/rejected/Approved) this on column 6.
The table is being created by razor and Datatable is being used on client side only.

Answers

This discussion has been closed.