Multi-column ordering with "asc" and "desc"

Multi-column ordering with "asc" and "desc"

zukiizukii Posts: 13Questions: 4Answers: 0

hey guys,

i have a dataTable with multi-column ordering and it works but I need:

first column "asc" and second column desc -> how is this possible?

here is my fiddle: https://jsfiddle.net/zukii/Lucq6vc5/28/

in this fiddle the column "Rating" is automatic default sorting "asc" and then the column "Price" should be automatic "desc"

thanks and greetings ;)

Answers

  • zukiizukii Posts: 13Questions: 4Answers: 0

    it should be -> best rating with lowest price!

  • allanallan Posts: 61,715Questions: 1Answers: 10,107 Site admin

    Unfortunately the columns.orderData option doesn't currently support the ability to sort columns in different directions. That is subject to a feature request at the moment.

    Currently you'd need to listen for the order event and see if ordering is being applied to column index 3 only. If so, then reapply ordering and set it to the multi-column ordering required.

    Allan

This discussion has been closed.