Bug in ColReorder destruction?

Bug in ColReorder destruction?

gboyskogboysko Posts: 10Questions: 0Answers: 0
edited December 2012 in Plug-ins
I am seeing the following error when I try to reinitialize a DataTables instance (which uses ColReorder) with new data. Before creating the second instance, however, I call fnDestroy on it. When I create the second instance, I get this warning from the console:

DataTables warning (table id = 'DataTables_Table_0'): ColReorder attempted to initialise twice. Ignoring second

Looking at the ColReorder code, it looks like it is incorrectly detects whether it was previously cleaned up or not.

When the instance is properly destroyed, ColReorder removes the value on the _oPluginColReorder property. [See line 871]

When creating a new instance, ColReorder tries to check this property: [See line 963]

if ( typeof oTable._oPluginColReorder == 'undefined' ) {

I think the correct check would be:

if (!oTable._oPluginColReorder) {

Thoughts?
Glenn

Replies

  • gboyskogboysko Posts: 10Questions: 0Answers: 0
    Alternatively, instead of setting the property to null, perhaps the code should be calling:

    [code]delete this.s.dt.oInstance._oPluginColReorder;[/code]

    We will work around the problem by doing this call in our own code until there is a resolution.
This discussion has been closed.