How do I search for a string in a hidden column and add a class to the row where it is

How do I search for a string in a hidden column and add a class to the row where it is

igonzalezigonzalez Posts: 1Questions: 0Answers: 0
edited May 2011 in General
Hi, This is my first post, I am new to datatables

How do I:

Search the table for a string in a hidden column and then add a class to the row where it is

Thanks in advanced,

Replies

  • ChrisGedrimChrisGedrim Posts: 10Questions: 0Answers: 0
    igonzalez,

    Assuming that the hidden column you want to search in is the first column; do this:

    [code]
    var oTable = $('table').dataTable( {
    "fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull){
    if (aData[0] == 'valueToSearchFor'){
    $(nRow).addClass("new-class-name")
    }

    return nRow
    }
    } )
    [/code]
This discussion has been closed.