1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Update media/src/core/core.support.js

Use firstChild / nextSibling rather than childNodes
This commit is contained in:
Tim Tucker 2012-08-31 18:25:23 -03:00
parent 1001a332fb
commit dd616424b9

View File

@ -1,5 +1,4 @@
/**
* Return the settings object for a particular table
* @param {node} nTable table we are using as a dataTable
@ -53,7 +52,7 @@ function _fnGetTdNodes ( oSettings, iIndividualRow )
{
var anReturn = [];
var iCorrector;
var anTds;
var anTds, nTd;
var iRow, iRows=oSettings.aoData.length,
iColumn, iColumns, oData, sNodeName, iStart=0, iEnd=iRows;
@ -71,13 +70,15 @@ function _fnGetTdNodes ( oSettings, iIndividualRow )
{
/* get the TD child nodes - taking into account text etc nodes */
anTds = [];
for ( iColumn=0, iColumns=oData.nTr.childNodes.length ; iColumn<iColumns ; iColumn++ )
nTd = oData.nTr.firstChild;
while ( nTd )
{
sNodeName = oData.nTr.childNodes[iColumn].nodeName.toLowerCase();
sNodeName = nTd.nodeName.toLowerCase();
if ( sNodeName == 'td' || sNodeName == 'th' )
{
anTds.push( oData.nTr.childNodes[iColumn] );
anTds.push( nTd );
}
nTd = nTd.nextSibling;
}
iCorrector = 0;