Permalink
Browse files

Dev: Fix logic check for passing data to the updated _fnCreateTr method

  • Loading branch information...
1 parent 5209e2f commit 0ff085873466e3ff2946261fdb9cd1df25c3d483 @DataTables committed Oct 31, 2012
Showing with 16 additions and 16 deletions.
  1. +8 −8 media/js/jquery.dataTables.js
  2. +8 −8 media/src/core/core.draw.js
@@ -996,23 +996,23 @@
* Create a new TR element (and it's TD children) for a row
* @param {object} oSettings dataTables settings object
* @param {int} iRow Row to consider
- * @param {node} [nTr] TR element to add to the table - optional. If not given,
+ * @param {node} [nTrIn] TR element to add to the table - optional. If not given,
* DataTables will create a row automatically
* @param {array} [anTds] Array of TD|TH elements for the row - must be given
* if nTr is.
* @memberof DataTable#oApi
*/
- function _fnCreateTr ( oSettings, iRow, nTr, anTds )
+ function _fnCreateTr ( oSettings, iRow, nTrIn, anTds )
{
var
row = oSettings.aoData[iRow],
rowData = row._aData,
- nTd, oCol,
+ nTr, nTd, oCol,
i, iLen;
if ( row.nTr === null )
{
- nTr = nTr || document.createElement('tr');
+ nTr = nTrIn || document.createElement('tr');
/* Use a private property on the node to allow reserve mapping from the node
* to the aoData array for fast look up
@@ -1035,10 +1035,10 @@
{
oCol = oSettings.aoColumns[i];
- nTd = nTr ? anTds[i] : document.createElement( oCol.sCellType );
+ nTd = nTrIn ? anTds[i] : document.createElement( oCol.sCellType );
// Need to create the HTML if new, or if a rendering function is defined
- if ( !nTr || oCol.mRender || oCol.mData !== i )
+ if ( !nTrIn || oCol.mRender || oCol.mData !== i )
{
nTd.innerHTML = _fnGetCellData( oSettings, iRow, i, 'display' );
}
@@ -1051,11 +1051,11 @@
// Visibility - add or remove as required
row._anHidden[i] = oCol.bVisible ? null : nTd;
- if ( oCol.bVisible && ! nTr )
+ if ( oCol.bVisible && ! nTrIn )
{
nTr.appendChild( nTd );
}
- else if ( ! oCol.bVisible && nTr )
+ else if ( ! oCol.bVisible && nTrIn )
{
nTd.parentNode.removeChild( nTd );
}
@@ -2,23 +2,23 @@
* Create a new TR element (and it's TD children) for a row
* @param {object} oSettings dataTables settings object
* @param {int} iRow Row to consider
- * @param {node} [nTr] TR element to add to the table - optional. If not given,
+ * @param {node} [nTrIn] TR element to add to the table - optional. If not given,
* DataTables will create a row automatically
* @param {array} [anTds] Array of TD|TH elements for the row - must be given
* if nTr is.
* @memberof DataTable#oApi
*/
-function _fnCreateTr ( oSettings, iRow, nTr, anTds )
+function _fnCreateTr ( oSettings, iRow, nTrIn, anTds )
{
var
row = oSettings.aoData[iRow],
rowData = row._aData,
- nTd, oCol,
+ nTr, nTd, oCol,
i, iLen;
if ( row.nTr === null )
{
- nTr = nTr || document.createElement('tr');
+ nTr = nTrIn || document.createElement('tr');
/* Use a private property on the node to allow reserve mapping from the node
* to the aoData array for fast look up
@@ -41,10 +41,10 @@ function _fnCreateTr ( oSettings, iRow, nTr, anTds )
{
oCol = oSettings.aoColumns[i];
- nTd = nTr ? anTds[i] : document.createElement( oCol.sCellType );
+ nTd = nTrIn ? anTds[i] : document.createElement( oCol.sCellType );
// Need to create the HTML if new, or if a rendering function is defined
- if ( !nTr || oCol.mRender || oCol.mData !== i )
+ if ( !nTrIn || oCol.mRender || oCol.mData !== i )
{
nTd.innerHTML = _fnGetCellData( oSettings, iRow, i, 'display' );
}
@@ -57,11 +57,11 @@ function _fnCreateTr ( oSettings, iRow, nTr, anTds )
// Visibility - add or remove as required
row._anHidden[i] = oCol.bVisible ? null : nTd;
- if ( oCol.bVisible && ! nTr )
+ if ( oCol.bVisible && ! nTrIn )
{
nTr.appendChild( nTd );
}
- else if ( ! oCol.bVisible && nTr )
+ else if ( ! oCol.bVisible && nTrIn )
{
nTd.parentNode.removeChild( nTd );
}

0 comments on commit 0ff0858

Please sign in to comment.