Update fnFindCellRowNodes.js and fnFindCellRowIndexes.js to work with

objects

- Based on the discussion here:
  http://datatables.net/forums/discussion/19044

- Use fnGetData to get the data for a cell, regardless of data source
pull/40/head
Allan Jardine 11 years ago
parent 40e2d46e03
commit f3e99a6c02

@ -25,8 +25,9 @@
jQuery.fn.dataTableExt.oApi.fnFindCellRowIndexes = function ( oSettings, sSearch, iColumn )
{
var
i,iLen, j, jLen,
aOut = [], aData;
i,iLen, j, jLen, val,
aOut = [], aData,
columns = oSettings.aoColumns;
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
{
@ -34,15 +35,17 @@ jQuery.fn.dataTableExt.oApi.fnFindCellRowIndexes = function ( oSettings, sSearch
if ( iColumn === undefined )
{
for ( j=0, jLen=aData.length ; j<jLen ; j++ )
for ( j=0, jLen=columns.length ; j<jLen ; j++ )
{
if ( aData[j] == sSearch )
val = this.fnGetData(i, j);
if ( val == sSearch )
{
aOut.push( i );
}
}
}
else if ( aData[iColumn] == sSearch )
else if (this.fnGetData(i, iColumn) == sSearch )
{
aOut.push( i );
}

@ -25,8 +25,9 @@
jQuery.fn.dataTableExt.oApi.fnFindCellRowNodes = function ( oSettings, sSearch, iColumn )
{
var
i,iLen, j, jLen,
aOut = [], aData;
i,iLen, j, jLen, val,
aOut = [], aData,
columns = oSettings.aoColumns;
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
{
@ -34,15 +35,17 @@ jQuery.fn.dataTableExt.oApi.fnFindCellRowNodes = function ( oSettings, sSearch,
if ( iColumn === undefined )
{
for ( j=0, jLen=aData.length ; j<jLen ; j++ )
for ( j=0, jLen=columns.length ; j<jLen ; j++ )
{
if ( aData[j] == sSearch )
val = this.fnGetData(i, j);
if ( val == sSearch )
{
aOut.push( oSettings.aoData[i].nTr );
}
}
}
else if ( aData[iColumn] == sSearch )
else if (this.fnGetData(i, iColumn) == sSearch )
{
aOut.push( oSettings.aoData[i].nTr );
}

Loading…
Cancel
Save