How to get row data using a search.

How to get row data using a search.

wyattbikerwyattbiker Posts: 25Questions: 14Answers: 0

I can use onclick to capture the data as follows:
usertable.row(this).data();

Is there a way to get the data of a row by supplying DT_rowId or a UserID in the current table?

for example can i do something similar to usertable.row("DT_rowId == 100").data() or some other similar method?

Also can I get the data of the currently selected row?

What I have been resorting to, is saving "this" and passing it to the methods..

Thanks

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    You can use the row-selector for the above options.

    Kevin

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    With the DT_RowId you can use an id selector (e.g. #100). For selection by other data points you'd need to use the row selector as a function, which is described in the documentation Kevin linked to.

    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Also can I get the data of the currently selected row?

    Yes - see the select API integration documentation.

    Allan

This discussion has been closed.