Skip to content

Commit

Permalink
Fix: Columns which are sortable but hidden have events attached to th…
Browse files Browse the repository at this point in the history
…em for sorting, but this event handler is not removed when the column is made visible again for fnDestroy. Simply need to change the order of how the destroy is done - i.e. remove events just after the columns are made visible, not before - 5497
  • Loading branch information
Allan Jardine committed Jun 25, 2011
1 parent d21a852 commit 41bf4e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions media/js/jquery.dataTables.js
Expand Up @@ -2138,9 +2138,6 @@
/* Flag to note that the table is currently being destoryed - no action should be taken */
oSettings.bDestroying = true;

/* Blitz all DT events */
$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');

/* Restore hidden columns */
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
{
Expand All @@ -2150,6 +2147,9 @@
}
}

/* Blitz all DT events */
$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');

/* If there is an 'empty' indicator row, remove it */
$('tbody>tr>td.'+oSettings.oClasses.sRowEmpty, oSettings.nTable).parent().remove();

Expand Down

0 comments on commit 41bf4e2

Please sign in to comment.