Perspective Table - Selected Rows

I have a table where I would like to update many cells at the same time.

If I have props.selection.enableRowSelection and .enableColumn selection enabled. I get a dataset .props.selection.data that contains just the column name and cell value as a dictionary. I have no way to identify the row for those cells and get back the id value for that row.

If you need that data you should be using the onSelectionChange Event for the component.

    Fired when the table selection has changed.

	Arguments:
		self: A reference to the component that is invoking this function.
		event: An object with the following attributes:
			data (list): The current selection data.
			selectedColumn (str | int | None): The current selected column.
			selectedRow (int | None): The current selected row. Can be an
			                          integer, or null. The unique row index as it is represented in the
			                          source data. Also known as the row ID.

When I detect a tab press, and change the selectedcolumn. The row cell being edited does not change. I still see the editor for C4 but the selected row is C5.

Considering the number of views this question has gotten while remaining unsolved, I figured it was worth a reply. I hope it helps!

A workaround that I’ve used for a similar issue is to add a rowId column to the data itself. You’ll have to configure the table to hide that column using the myTable.props.columns array, but that’s pretty easy to do. Then, when you use the props.selection.data property, you’ll have access to which rows were selected relative to the underlying dataset.

Sidenote: In Vision, there’s a hidden selectedRows property on the power table (you have to use the javadocs to find it), but I couldn’t find a similar hidden property for tables in Perspective. It’d be nice to see properties like these exposed and easy to use.