reset sorting in table

reset sorting in table

abdel_ouzzabdel_ouzz Posts: 2Questions: 1Answers: 0
edited September 2018 in Free community support

hello
i want to reset default sorting in datatables after (i.e. 3rd click in column ) please can someone help me

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @abdel_ouzz ,

    You can use order() to reset the order.

    Cheers,

    Colin

  • abdel_ouzzabdel_ouzz Posts: 2Questions: 1Answers: 0

    hi @colin
    thank you for your answer, but i want when i click for example the third time in head of column reset the ordering of table, or double click...
    but i test the method of order() it doesn't work for my situation

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @abdel_ouzz ,

    That will need a modification to the existing sorting. This thread here might help, especially my example at the end. This is removing the default ordering, and reapplying new logic. You could do something similar to get the effect you want.

    Cheers,

    Colin

This discussion has been closed.