initComplete Sporadic Firing

initComplete Sporadic Firing

daduffydaduffy 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!

Answers

  • kthorngrenkthorngren Posts: 21,445Questions: 26Answers: 4,974

    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

  • daduffydaduffy Posts: 31Questions: 5Answers: 1

    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.

  • kthorngrenkthorngren Posts: 21,445Questions: 26Answers: 4,974
    edited May 2020

    Here is a list of events:
    https://datatables.net/reference/event/

    You can try preInit or event the init.

    What version of Datatables are you using?

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

This discussion has been closed.