Getting Row ID from Search

Getting Row ID from Search

RedfishRedfish Posts: 7Questions: 3Answers: 0

I am trying to get the row.data by doing a search against a specific column. This will supply what I need however I don't know the row.
var test = table.row(0).data()

I have tried to search against the row to get the index but all I get back is 0, not found essentially. I thought this would do it but no luck.
var test = table.column(0).search('string')

What is the easy method to search a string and either return the matched row index or ideally the data from that row?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922
    edited May 2020 Answer ✓

    I think what you are looking for is the row-selector as a function for the row() API. There is an example in the row-selector docs.

    Using search() is meant to search the table and update the table display showing the filtered results.

    Kevin

  • RedfishRedfish Posts: 7Questions: 3Answers: 0

    That worked perfect for me thanks. Wasted an hour looking before I posted lol.

This discussion has been closed.