Hi,
I am currently programming an ajax-based website, which loads ALL its content always via ajax. There are a lot of datatables initialised when surfing through the site, but only one specific table has the fixedColumns option to true.
When I load this table, then load some other stuff into the website (the datatable disappears) and load the pagecontent with this table again, I get this error in my console:
uncaught exception: FixedColumns already initialised on this table
Thing is: all datatables get created through the same js function I wrote, and there the option destroy is set to true. This should prevent the "already initialised" error from popping up, as - if I understand the destroy option correctly - whenever a datatable is already initialised, it will get destroyed and then initialised again, automatically...?
Furthermore, all the tables get saved in an array while created -->
datatables[tid]=$("#"+tid).DataTable( { destroy: true, .......
I already tried just manually destroying ALL available tables:
var _tmp=Object.keys(datatables);
$.each(_tmp, function( index,value ) {
if ($("#"+value).length==1)
datatables[value].destroy();
});
But still the error pops up. How is that even possible??
If there is no easy answer without reviewing all of my code (there is a lot), is there at least a way catch this error and "UNinitialise" the table on-the-fly?
Thank you for your suggestions!
Marcus