How to make the orderable option available and also order the data in descending order

How to make the orderable option available and also order the data in descending order

KEshav09KEshav09 Posts: 18Questions: 9Answers: 0

so in the datatables when i give order:[[2,'desc']] the data table is ordered accordingly but the column headers are not clickable
but if i use ordering : true and order:[[2,'desc']] the column headers are clickable but the data is not ordered in the way i want

how can i enable the column header click-ability to sort the data and also order the data in the way i want on the initial render

This question has an accepted answers - jump to answer

Answers

  • KEshav09KEshav09 Posts: 18Questions: 9Answers: 0
         data: dataSet,
          destroy: "true",
          searching: "true",
          order:[[2, 'desc']],
          retrieve: "true",
          paging: "true",
          bSortable: true,
          responsive: true,
    
          lengthChange: "true",
    

    These are my settings for the initial render

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Answer ✓

    I'd need to take a look at a test case showing the issue please. What you have looks okay (although you have a number of boolean options as strings and also both destroy and retrieve specified in the same object, which is invalid.

    Allan

Sign In or Register to comment.