fnDraw() functionality is inconsistent
fnDraw() functionality is inconsistent
readylee
Posts: 6Questions: 0Answers: 0
Hi,
I am using DataTables and it's great, but I am witnessing inconsistent behavior with the fnDraw(false) function.
I have an object in each page (var oTable) which is a dataTable instance. Particularly after performing a delete operation, I call oTable.fnDraw(false). Most of the time, the table is re-drawn as expected, and the deleted record is no longer there. However, sometimes the re-draw doesn't seem to happen. If I re-fresh the page then I can see that the record has been removed, but I am wondering why my call -- oTable.fnDraw(false) -- doesn't seem to be executed every time, or is ineffectual. The crazy thing is that now I'm calling it about 4 times for a single delete operation, but I still sometimes need to refresh the page in order to see that the record has been deleted. Please advise!
I am using DataTables and it's great, but I am witnessing inconsistent behavior with the fnDraw(false) function.
I have an object in each page (var oTable) which is a dataTable instance. Particularly after performing a delete operation, I call oTable.fnDraw(false). Most of the time, the table is re-drawn as expected, and the deleted record is no longer there. However, sometimes the re-draw doesn't seem to happen. If I re-fresh the page then I can see that the record has been removed, but I am wondering why my call -- oTable.fnDraw(false) -- doesn't seem to be executed every time, or is ineffectual. The crazy thing is that now I'm calling it about 4 times for a single delete operation, but I still sometimes need to refresh the page in order to see that the record has been deleted. Please advise!
This discussion has been closed.
Replies
Allan
Allan
However, that doesn't explain why fnDraw(false) would sometimes work and sometimes not. I think I'll need more information in order to help though... For example are you using server-side processing? If so, are you firing of the redraw XHR at the same time as the delete XHR - might they be overlapping? I would say that the redraw call should be in the delete callback.
Allan