Can't get a table to focus on the last row on return

Summary

A table is indexed on a 'row1' column and the selected row's row1 value (e.g. 44) is saved to localStorage; on returning to the table, setting the Default row to {{localStorage.values.mIndex}} does not re-select/focus that row.

AI Response

The Default selected row setting expects a positional row index (0-based), not a stored column value like 44, which is why passing mIndex directly doesn't match. Instead, compute the index by finding where the column value equals the stored value, e.g. set the default row to {{ table1.data.findIndex(r => r.row1 == localStorage.values.mIndex) }}. Alternatively, on the table's data load, run table1.selectRow({ mode: 'key', key: localStorage.values.mIndex }) to select by matching value rather than position.

Sources

:bookmark: Select row of table based on table data property
Covers selecting a table row by a data property/ID value rather than by numeric index, matching the goal of re-selecting the row where row1 equals the stored value.
:bookmark: How to Select Table rows programatically?
Solved thread showing how to programmatically select rows with table.selectRow(), which can be triggered on load to focus the stored row.

The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a :heart:, :+1:, or :-1:. Or by marking this post as the "Solution"! Let us know if you have any feedback here. :rocket: