Get Datatable Row Index

Get Datatable Row Index

standinibarrastandinibarra Posts: 15Questions: 5Answers: 0
edited March 2021 in Free community support

How can I get datatable row index using id attribute?

I tried using

$("#dataTable").fnGetPosition( document.getElementById("tr_16") )
$("#myTable").fnGetPosition( $("#tr_16") )

but it says fnGetPosition is not a function.

what I want to get is the actual datatable row index, not just index of shown data

Answers

  • standinibarrastandinibarra Posts: 15Questions: 5Answers: 0

    example: I have 3 pagination. each contains 10 rows with overall total of 34 rows.
    last index is equal to 33. (starts with 0 index)

    I wanted to get the index 22 based on its tr id attribute. <tr id="tr_22">

    need help.

  • kthorngrenkthorngren Posts: 20,145Questions: 26Answers: 4,736

    Looks like you can use row().id(). You can use any appropriate row-selector to pass into the row() API.

    Kevin

This discussion has been closed.