initComplete Sporadic Firing
initComplete Sporadic Firing
daduffy
Posts: 31Questions: 5Answers: 1
So, I am wondering more if anyone has ever seen the initComplete function fire sporadically. I have tried a billion different things to reproduce the problem consistently, but have not been able to.
Is there something that could cause a race condition?
Due to an NDA I cannot post my case... but if you haven't heard of this sort of behaviour before, I will do something to try and reproduce in a test case. Thanks in advance!
This discussion has been closed.
Answers
I've never seen
initComplete
not fire. It will only run once after the Datatable initialization is complete. I would start with putting a console.log statement in the function to verify that it runs. Do you get errors in the browser's console when it doesn't run?Kevin
No, I don't get errors. I actually stripped out everything from the initComplete function and just had a console.log running and the issue still keeps happening.
I have never had problems with it in all my years working with DT... it is very perplexing.
It fails to fire, maybe 1 in 20 times. I was wondering if there were some other events that would make sense to try out and write them to the console as it went through, see if there is something in the chain that isn't working, or if @allen or @colin had ever heard of that sort of thing happening before.
Here is a list of events:
https://datatables.net/reference/event/
You can try
preInit
or event theinit
.What version of Datatables are you using?
Kevin
Not heard of anything. The best way to progress this would be to create a test case that demonstrates the issue. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin