Columns from previous table - how to completely remove leftovers?

Columns from previous table - how to completely remove leftovers?

okkkookkko Posts: 3Questions: 2Answers: 1

Hello,

First of all - awesome plugin! Much appreciated!

Now, the problem... I have two different (html generated) sources for my datatable. I initialise it with "destroy" option. However, if previous table had more columns, I get this error on second initialisation: Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined (https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js line 24).

If previous table had less columns I get Uncaught TypeError: Cannot read property 'mData' of undefined (line 90).

I have the object reference, so I get the API and I've tried to manually "destroy" and various other options like state.clear(), set the object reference to null etc.. Nothing helped.

I've searched the forum but could not find the answer. In my opinion the destroy function should also clear header row. Is it a bug? Any workarounds?

This discussion has been closed.