Datatable columnDefs condition

Datatable columnDefs condition

Alexgolf7Alexgolf7 Posts: 4Questions: 2Answers: 0
edited April 2022 in General

There is a way to something like :

columnDefs: [
            if(sorting direction of the target is 'asc'){
                { orderData: [14,13,12,0],    targets: 0 }
            }
            else{
                { orderData: [18,13,12,0],    targets: 0 }
            }
]

Thanks

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    No, there's not. But you could possible listen for the order, get the current order, and if it is just column 0, change the sorting to be how you want with sort(),

    Colin

  • Alexgolf7Alexgolf7 Posts: 4Questions: 2Answers: 0

    Thnaks ! It is not only for column 0 but also for 1 or 2 or 3 ....

Sign In or Register to comment.