diff --git a/js/api/api.core.js b/js/api/api.core.js index 67bdda11..5dd7bf7a 100644 --- a/js/api/api.core.js +++ b/js/api/api.core.js @@ -142,6 +142,8 @@ _api_register( 'destroy()', function ( remove ) { jqTable.append( tfoot ); } + settings.colgroup.remove(); + settings.aaSorting = []; settings.aaSortingFixed = []; _fnSortingClasses( settings ); diff --git a/test/api/core/destroy().js b/test/api/core/destroy().js index 7628bde5..02b11f96 100644 --- a/test/api/core/destroy().js +++ b/test/api/core/destroy().js @@ -43,6 +43,10 @@ describe('core - destroy()', function() { testElementsPresent(false); }); + it('Confirm that colgroup is removed', function() { + expect($('#example colgroup').length).toBe(0); + }); + dt.html('basic'); it('Check default is false', function() { table = $('#example').DataTable();