I get this error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is
I get this error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is
offir.peer
Posts: 9Questions: 4Answers: 0
When I try to use the destroy() function on my datatable I get this error.
Take a look at my question here:
http://stackoverflow.com/questions/40628667/datatables-error-when-using-destroy-failed-to-execute-insertbefore-on-node
I try to reproduce this(Bug maybe?), in my plunker but without success.
https://plnkr.co/edit/guXUsqah2p7TpnsjQVBo?p=preview
Why do I get this error when I try to destroy the table, I am using the same version of datatable as in my Demo.
This discussion has been closed.
Answers
My guess is that the original node has been removed itself, but we'd really need a test case showing the issue to be able to debug it.
Allan
The fiddle I added is almost the exact thing I do in my project, same versions of jquery and datatables, any idea what could be the problem?
Not really. You noted above that you weren't able to replicate the issue in Plnkr, which suggests either a version difference or some other code difference that is triggering the issue in your local code. That's why I mentioned above that we'd need to be able to see the error to understand what is going on.
Having said all that - I've just spotted one thing. Your
dom
doesn't have at
option. That is required since thet
is the table. Try adding that in.Allan
But in plunker it works fine without the "t" in the dom.
Yup - I'm surprised by that. That's the only thing I spotted as odd though. Did you try it? If it isn't that, I'd need a way to be able to see the error to be able to offer any help as I can't guess what the issue is.
Allan
This guy had the same problem, I don't know if he solved it, but can you take a look, maybe you will spot something there?
https://datatables.net/forums/discussion/28081/how-to-update-table-when-dom-changes-destroy-init-crash
Here is the code he used working. I didn't follow up on that post since he notes he got it working.
Allan