Suggestion: Allow function in dt.draw() calls
Suggestion: Allow function in dt.draw() calls
Would be GREAT to see the ability to pass a function with any draw() commands. Obviously, one would expect the "main" drawCallback function to fire (as defined on the table setup), but the ability to add another function to run from a specific draw() call would be great. (Or maybe allow a second boolean parameter to prevent the primary drawCallback() from firing.)
For example, I might be editing a row (not live edit, but like in a modal, changing a record status), and then I'm returning the results to refresh a given row. I might want to "do something" after my .draw() call is made. Like thus: dt.row(0).data(oNewData).draw(function(){ alert('refreshed your row');}); If the function() could support params that would be added when fired from Datatables, such as a pointer to the table, etc., that would be great too. (Much like the column render() functions have implicit arguments that are passed.)
Replies
I would suggest just using the
one()
method and thedraw
event. For example:Allan