Editor: How to get DT_RowId for the row of a cell being edited inline?

Editor: How to get DT_RowId for the row of a cell being edited inline?

bcraunbcraun Posts: 2Questions: 1Answers: 0

I am trying to obtain the DT_RowId for the row of a cell that's being inline edited. I'm not seeing a way from the API to accomplish this? Is this possible?

Thank you

Answers

  • allanallan Posts: 61,934Questions: 1Answers: 10,155 Site admin

    Yes, the modifier() method can be used to access whatever was used to trigger the editing - with inline editing that is normally a cell, so you can use:

    var modifier = editor.modifier();
    var id = table.row( modifier.parentNode ).data().DT_RowId;
    

    Another option is to use multiGet() which has the row ids in the object keys.

    Sounds look a good addition as an API method though - thanks!

    Allan

  • bcraunbcraun Posts: 2Questions: 1Answers: 0

    Yes, that works perfectly. Thanks!

  • allanallan Posts: 61,934Questions: 1Answers: 10,155 Site admin

    Little update on this should anyone find this thread - as of Editor 1.7.4 (to be released this week), there is a new ids() function that can be used to get the ids of the rows being edited.

    Allan

This discussion has been closed.