How to get the row.index of the sorted columns?

How to get the row.index of the sorted columns?

Nosheen JavedNosheen Javed Posts: 3Questions: 2Answers: 0

Hello,
I am trying to get the rowIndex of the newly created row and select that page where the record is present. It is working fine without the sorting. But problem lies when I sort the table and then create the new row, It shows the correct rowID and the rowIndex is wrong. Is there any way I can find the rowIndex on the new row after sorting?
Thanks,

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,985Questions: 1Answers: 10,162 Site admin
    Answer ✓

    row().index() is how you get a row index. The row.add() method returns an API instance with the new row selected, so you could use:

    var row = table.row.add( ... );
    var index = row.index();
    

    Allan

This discussion has been closed.