Can I cancel a draw event?

Can I cancel a draw event?

GazNewtGazNewt Posts: 1Questions: 0Answers: 0
edited December 2010 in General
Hi there,

DataTables is, frankly, brilliant.

I have a table where the user can make the data "dirty". They can then click a "Submit Changes" button to submit the dirty data to the server to synchronize the UI and back end.

I want to be able to display a confirmation message if the user triggers an event that will redraw the table eg; paging, sorting, filtering or changing the page length. Otherwise the user will lose the dirty data in the page refresh. The confirmation will be "You have unsaved data in this page, do you want to save your changes now?"

I've tried fnDrawCallback but it is called after the table has already been drawn.

Is there a built in event I can implement for this?

Thanks

Replies

  • ambrauerambrauer Posts: 2Questions: 0Answers: 0
    I had to do something similar. There was nothing built-in to handle this, but I made the changes to implement a "fnPreDrawCallback" in my fork here: https://github.com/ambrauer/DataTables/commit/688cdb6c7cba5dcd1716289fa3def49ed627e361
This discussion has been closed.