How can we reinitialize the datatable?
How can we reinitialize the datatable?
siddhantjm
Posts: 14Questions: 2Answers: 0
Hello, When I reload the table for someother record using javascript array it gives me an error reinitialization not possible. Can I know how can I overcome this issue and reinitialize the table because this is what I actually wanted.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Maybe you can post your code or better a link to a page or a test case showing the issue so we can help troubleshoot.
The info in this tech note might be helpful:
https://datatables.net/manual/tech-notes/3
Kevin
$('#example').dataTable( {
paging: false,
searching: false
} );
I had used the above code but was not able to solve the error.
Are you using
destroy
, as described here in the technote?Kevin
No. I'll try using it now and see.
Thanks in advance.
Siddhant
Yes! it worked.
Thanks a Ton!!!
But it gives me the warning before using an alert popup. How can I stop that?
What is the warning?
Does the warning have a link to a tech note? If so then try the steps provided in the tech note to start troubleshooting.
Kevin
The same warning in the alert box cannot re-instantiate.
It works fine but it pops the warning first and once you block further popups using the checkbox it works fine.
Somewhere in your code you must have an additional
$('#example').dataTable();
causing the alert. Without seeing your full JS code or a test case with the issue its hard to say why the alert is occurring.Kevin
Okay! I'll check and see and post a comment regarding the same.
Thanks !
Yes!!! It's done.
Thanks a ton. It works perfectly fine now.
Thanks a lot!!!!
Siddhant
And how can I give the scrollable property to the table? As the table consists of more than 100 records I cannot scroll through the table. So I just need to give the scrollable property to the table.
$.fn.dataTable.ext.errMode = 'none';
How do you actually use this code and where do you write this code so that the table doesnt popup any alerts.
If DataTables is throwing errors, then there is a problem somewhere. Hiding the errors is the wrong thing to do in my opinion. It doesn't make the error go away, it just stops the information reaching you that there is an error happening.
I would very much recommend you address the error. If you are having problems doing so, link to a test case so I can check it out.
Allan
The line worked.
Sure - it will hide the error. But it doesn't stop the error from happening!