From 08619a3a2180122644a203622f0ab99185ac123a Mon Sep 17 00:00:00 2001 From: Tim Tucker Date: Fri, 31 Aug 2012 10:48:55 -0300 Subject: [PATCH 1/3] Update media/js/jquery.dataTables.js Update doc to reflect that _fnGetWidestNode returns a node, not a string. --- media/js/jquery.dataTables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 4ff926dc..fd70596c 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -3765,7 +3765,7 @@ * Get the widest node * @param {object} oSettings dataTables settings object * @param {int} iCol column of interest - * @returns {string} max string length for each column + * @returns {node} widest table node * @memberof DataTable#oApi */ function _fnGetWidestNode( oSettings, iCol ) From 6fa5559dc3036dfd6b4d65d641afb7731c9d19bd Mon Sep 17 00:00:00 2001 From: Tim Tucker Date: Fri, 31 Aug 2012 11:00:48 -0300 Subject: [PATCH 2/3] Update media/src/core/core.sizing.js Doc update -- getWidestNode returns node, not string --- media/src/core/core.sizing.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/src/core/core.sizing.js b/media/src/core/core.sizing.js index b502209d..ebc5c075 100644 --- a/media/src/core/core.sizing.js +++ b/media/src/core/core.sizing.js @@ -1,5 +1,4 @@ - /** * Convert a CSS unit width to pixels (e.g. 2em) * @param {string} sWidth width to be converted @@ -284,7 +283,7 @@ function _fnScrollingWidthAdjust ( oSettings, n ) * Get the widest node * @param {object} oSettings dataTables settings object * @param {int} iCol column of interest - * @returns {string} max string length for each column + * @returns {node} widest table node * @memberof DataTable#oApi */ function _fnGetWidestNode( oSettings, iCol ) From 3cc96cf58f157f525933bbd3bb0c4f1f961ecdf7 Mon Sep 17 00:00:00 2001 From: Tim Tucker Date: Fri, 31 Aug 2012 13:38:51 -0300 Subject: [PATCH 3/3] Update media/src/core/core.draw.js Cache row Avoid array access to childNodes Move unique calculation outside of loop Declare all vars at head of function Cache a[i] in fnShiftCol --- media/src/core/core.draw.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/media/src/core/core.draw.js b/media/src/core/core.draw.js index 66319ee5..d3579367 100644 --- a/media/src/core/core.draw.js +++ b/media/src/core/core.draw.js @@ -1,4 +1,3 @@ - /** * Create a new TR element (and it's TD children) for a row * @param {object} oSettings dataTables settings object @@ -691,10 +690,12 @@ function _fnAddOptionsHtml ( oSettings ) function _fnDetectHeader ( aLayout, nThead ) { var nTrs = $(nThead).children('tr'); - var nCell; - var i, j, k, l, iLen, jLen, iColShifted; + var nTr, nCell; + var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan; + var bUnique; var fnShiftCol = function ( a, i, j ) { - while ( a[i][j] ) { + var k = a[i]; + while ( k[j] ) { j++; } return j; @@ -711,19 +712,18 @@ function _fnDetectHeader ( aLayout, nThead ) /* Calculate a layout array */ for ( i=0, iLen=nTrs.length ; i