fnFindCellRowIndexes/fnFindCellRowNodes Not Working

fnFindCellRowIndexes/fnFindCellRowNodes Not Working

KA2012KA2012 Posts: 16Questions: 0Answers: 0
edited July 2012 in Plug-ins
Hello,

I am trying to use fnFindCellRowIndexes to find the row containing a string in column 1. I then want to highlight the row using fnDisplayRow. I have done this:

[code]

var idToFind = "UniqueStringSomewhereinColumn1";
var rowToHighlight = oTable.fnFindCellRowIndexes(idToFind);
//oTable.fnDisplayRow(oTable.fnGetNodes()[rowToHighlight]);

[/code]

I know that rowToHighlight returns an array, so the last line is probably not correct(can't pass an array of array to fnGetNodes). But my main problem is that rowtoHighlight is always empty! I debugged in firebug, and rowToHighlight always is [ ]. I tried fnFindCellRowNodes() as well, and it's the same result. I tried with and without passing the column number parameter.

I've included the API function code in js Files, and imported them. Not sure why these are not working. Am I using them incorrectly?

Replies

  • t1589t1589 Posts: 5Questions: 0Answers: 0
    I have a same problem. I debugged fnFindCellRowIndexes and found out that after this line in function code
    [code]
    aData = oSettings.aoData[i]._aData;
    [/code]

    variable aData is undefined

    can anyone tell me why?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you run your table through the debugger so we can see what might be happening?

    Allan
  • t1589t1589 Posts: 5Questions: 0Answers: 0
    debugger code: evowep

    The problem occurs in 1. table (alltasks)

    -Teemu-
  • t1589t1589 Posts: 5Questions: 0Answers: 0
    I implemented a workaround for this (I needed to search all columns in a row)

    [code]
    function findRowIndexUsingString(stringToCheckFor){
    var rowIndex = null;
    $.each(oTable.fnGetData(), function(i, dtRow) {
    $.each(dtRow, function(j, dtCol) {
    if (dtCol == stringToCheckFor) {
    rowIndex = i;
    }
    });
    });
    return rowIndex;
    }
    [/code]
  • WornWorn Posts: 7Questions: 0Answers: 0
    Hi,

    same for me fnFindCellRowIndexes does not work. I only get one item as result.

    Worn
This discussion has been closed.