Disable drawCallback on table (re)draw
Disable drawCallback on table (re)draw
dylanmac
Posts: 49Questions: 7Answers: 1
I am grouping rows in my table using the code example provided here:
https://datatables.net/examples/advanced_init/row_grouping.html
I want to provide a button next to my table that will resort the rows using a different column, and that will not group on that row. Since the grouping is accomplished via the drawCallback, how would I bypass the drawCallback when I resort and redraw the table?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
OK I figured it out. I surround the drawCallback function with a flag that is initially set to true, e.g.:
When the user clicks on the sort button, change the global var to false and pass it into the draw() function, e.g.
Voila.