How to get row nodes with table.search(value) method?

How to get row nodes with table.search(value) method?

sikaribasikariba Posts: 2Questions: 1Answers: 0

I want to change the background color of match rows like this:

I've found many examples here but almost of them are:

myDataTable.columns([1]).search('Engineer').draw()

I don't want to hide mismatched row but only highlight matched row, something like this:

myDataTable.columns([1]).search('Engineer').nodes().to$().addClass('highlight')

But it seems search method doesn't return the matched row element.
Anybody could help me? Thanks.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @sikariba ,

    I did something similar recently - take a look at this example from this forum chat.

    Hope that helps,

    Cheers,

    Colin

  • sikaribasikariba Posts: 2Questions: 1Answers: 0

    Thanks! That' s exactly what I want!

This discussion has been closed.