Getting sort order for Power Table?

Is there a way to get the sorted row indices from a power table?
Basically, after a user has applied the sorting to columns, I need a list of the sorted indices so I can process the underlying dataset based on this sorting info.

(using the viewDataset attribute is not sufficient because the underlying ID field is hidden on the component display)

I’m not sure if theres a prettier way to do this but depending on how unique the data is and how many columns with unique data there is, you might be able to create a sort of key column that would be identical between the viewDataset attriibute and the normal data attribute. So for each row the key value would be something like “col1 + col2 + col3…”, including all columns that are on both .data and .viewDataset. You can find the original ID based on what key in the .data matches a given key in .viewDataset.

Try table.getRowsInViewOrder(). (-: