Perspective Table rowIndex vs row

I have been looking in the documentation, and cant seem to find it, but what is the difference between rowIndex and row in the implicitly provided embedded view column parameters?

row is typed as number | string, so I guess in some circumstance it could be a string - where rowIndex is guaranteed to be a number.

Oh alright, but they are both references to the index of a row in the data property?

For some reason I remember one of them being a reference to the number of the row visualized on the screen, but I have no idea where I got that from

I also had the same vague recollection of one referring to what’s visualized and started searching for the distinction…only to find this post and its lack of answer haha. I found documentation on this annoyingly difficult to find, especially because trying to find on a page doesn’t account for content hidden under a collapsed section, which the docs use a lot of.

To save any future searchers, as it turns out, the implicitly passed row and rowIndex are indirectly described in the documentation for the onEditCellStart event of the table (Perspective - Table - Ignition User Manual 8.0 - Ignition Documentation) :

event.row
Description: The row index of the selected row (zero based).

event.rowIndex
Description: The row index as it is represented in the current visible data. Useful in cases where some of the rows are hidden, such as when filtering.

I found these descriptions to be consistent with what I was having implicitly passed. If I filtered my table to one element, it would register a rowIndex of 0 regardless of what its actual row in the dataset was, whereas row gives the actual spot in the dataset. This is important to be aware of if you plan to enable filtering or sorting and want to update table values. If you update values based on rowIndex, things will look like they work until you sort/filter, then you’ll be updating things practically at random! (Found that out the hard way…time to go fix up my dataset)

2 Likes