Re-sort table after data change

Re-sort table after data change

backseatbackseat Posts: 7Questions: 3Answers: 0
edited April 2018 in Free community support

I have a table that is sorted on a given column. If I update the row such that the data in the sorted column changes, what do I need to do to have DataTables move the row to the correct sorted location?

This question has an accepted answers - jump to answer

Answers

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17

    Here you might find a suggestion to resolve your issue: https://datatables.net/examples/server_side/select_rows.html

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    Call the draw() method. That will trigger a resort if required.

    Allan

  • backseatbackseat Posts: 7Questions: 3Answers: 0

    Thanks. I was calling draw(), but not until after I'd either shown or hidden a child row. Seems if I call draw() before manipulating the child status, the re-sort happens as expected, but if I call it after, it doesn't.

    Not sure whether that is expected behaviour, but anyway it's fixed for me!

This discussion has been closed.