¿How to recover the default order?

¿How to recover the default order?

hnubehnube Posts: 2Questions: 1Answers: 0

Description of problem:

Hello good night everyone,
I have a question that I cannot find an answer anywhere in this forum, so I open this thread.

I receive some data from an API in a certain order, then with datatable clicking on the row I can sort them in ascending and descending order.

Is there a way that I can return them as I received them from the ordered API? That is, click 1 orders ascending, click 2 orders descending and the last one leaves everything as we originally received it.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,227Questions: 1Answers: 10,416 Site admin
    Answer ✓

    This plug-in can be used to restore the original sort order of the table. There isn’t an option for a third click on a column to restore yet though - there will be in DataTables 2. I don’t yet have a timeline for when that will ship though - when it is ready... :).

    Allan

  • hnubehnube Posts: 2Questions: 1Answers: 0

    Thanks for the quick reply @allan , and by modifying the current code would it be possible to have that feature? Because it is exactly the function that I would need and I can't find it anywhere.

    Thanks for your time, mate

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

    Not yet, I'm afraid, that feature hasn't been implemented - so it's just a case of waiting for DT2 as Allan said.

    Colin

This discussion has been closed.