How to get physical row index to data from selections?

Does the Handsontable API provide a generic way to get the physical row index of selected items? I have searched the docs but came up empty.

I know the column sorting plugin has a untranslateRow() that allows you to get the physical index in the data set after sorting, but this method only works with untrimmed data.

On the flip side I know the trim rows plugin has a rowMapper object that you can get the physical index in the data set after trimming, but this mechanism is also is broken if the data is also sorted.

Hence my question, does Core provide any similar method that would work in all data manipulation scenarios?

Hi @shakiem_saunders

I think that you may look at toPhysicalRow method.

demo: http://jsfiddle.net/t79u4w66/

And here is what is looks like with trimming http://jsfiddle.net/0t72pre5/

2 Likes

@aleksandra_budnik Exactly what I was looking for!

Thank you! :grinning:

you’re welcome @shakiem_saunders