Is there any way to know when rowGroup rendering is completed?
Is there any way to know when rowGroup rendering is completed?
thangnv
Posts: 12Questions: 2Answers: 0
Hi, I use rowGroup
and sum a column in endRender
. The problem is if I create/edit a row, sum will be called twice. The first call is incorrect sum, and the second call is the correct one. I have to check for sum value and alert()
if it doesn't match a condition. As the result, one will be false alert. So is there a way to know that the rendering of rowGroup
is completed and perform the column sum after that?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
How are you doing this?
Please post a link to your page or a test case replicating the issue so we can see what you are doing and help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
I believe the rowGroup
rowGroup.endRender
function is only called when the table is drawn, ie, thedraw()
API is called. Maybe you are callingdraw()
or performing a function that is callingdraw()
more than once for you create/edit process.Kevin
@kthorngren Thank you for pointing it out. Yes, It's exactly what you've said. Because the
dt.draw()
doesn't refresh data after inserting/editing, I addeddt.ajax.reload()
and it unfortunately called table refreshing twice. Now I removedt.draw
and it works as expected.