Reg - Sorting

Reg - Sorting

armaanarmaan Posts: 19Questions: 7Answers: 1

Hello i have a order by descending order in my sql query but after using datatables this sorting changes , i need the default sorting to be disables but still i need sorting buttons

Answers

  • rduncecbrduncecb Posts: 125Questions: 2Answers: 28

    DataTables will ignore the ordering and use it's own. Use order to define how it should initially be sorted. You'll retain the sorting buttons on the column headers.
    To order by the first column in descending order use

    "order": [[ 0, 'desc' ]]
    
    

    Change the order option to suit your table.

  • armaanarmaan Posts: 19Questions: 7Answers: 1

    thanks @rduncecb its working

This discussion has been closed.