From 8c2c65c9dde77428e02a6b229a7a6a1c6cc66315 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 12 Nov 2013 19:18:06 +0000 Subject: [PATCH] New: Cached footer cells can now have colspan properties, allowing column index referencing of the cells. - Previously a colspan in a footer cell would cause index misalignment - for example if you had a table of 6 columns with two in the footer (one colspan=5) the fotoer cells would be assigned to the first two columns in the table, breaking column index order. Now a cell can be used over multiple columns. This allows column().footer() to always reflect the cell that belongs to that column (possibly sharing it with other columns). - Note that the footer will only use cells from the first row in the footer. If there is more than one row, use table().foot() to access the TFoot element and then manipulate it as needed. --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index fc0f3bdd..ca19852a 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -7a5f2b1397221a7c3e889f45cb4946cff217c5b4 +8fa5b8aa7a24d4cc087a89f821095ad1756309da diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 1f99168e..936a6634 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -1544,19 +1544,19 @@ $(thead).find('>tr>th, >tr>td').addClass( classes.sHeaderTH ); $(tfoot).find('>tr>th, >tr>td').addClass( classes.sFooterTH ); - /* Cache the footer elements */ + // Cache the footer cells. Note that we only take the cells from the first + // row in the footer. If there is more than one row the user wants to + // interact with, they need to use the table().foot() method. Note also this + // allows cells to be used for multiple columns using colspan if ( tfoot !== null ) { - var anCells = _fnGetUniqueThs( oSettings, null, oSettings.aoFooter ); + var cells = oSettings.aoFooter[0]; for ( i=0, ien=columns.length ; i