Wrong index after filter

Tags: #<Tag:0x00007efc72f83a70>

Precisely, I am accessing the data on click event by the coords.row, but after applying the filter, the row indices are reset for the filtered elements.

Like if data is originally on 7th row in a table, having index=8. But, after applying filter, if it’s on top, the index will become 0, though it’s original position in data is still index=8, which causes inappropriate data mapping.

Kindly let me know the solution, I searched in forums and saw multiple similar issues, but none particularly guides in that way.

Hi @mehdiraza

You can use this method to convert visual row to the physical row. That should solve the problem.

https://handsontable.com/docs/api/core/#tophysicalrow

Here’s also a similar topic: Way to have row's reference in cellMeta

1 Like

Thanks for the quick response. Yes, toPhysicalRow worked. I was expecting any prop or flag for converting those visual rows automatically to the physical rows.

Thanks

That’s great to hear. I’m closing this topic then.