Table Component Default Select

Hey everyone!

I was having issues on trying to get my table to select the first row whenever I get to a page. Below is a image to showcase my problem. Whenever a user clicks and goes to this page, I would like for my table to auto select the first row so that it populates a trend that is shown on the right side of the table. Currently, I have it working when a user clicks on the row, but I wanted the row to already be selected when it starts up or a user goes to the page for the first time.

Thank you guys in advance!

Set PROPS.selection.selectedRow: 0

Would I set this on the onStartUp event script for the table? Because I tried to implement but it was still giving me the same problem.

Again, thank you for the response!

Create an onStartup event script on the table. Here’s one for the default Folsom table:

def runAction(self):
	Method that will run whenever the selected event fires.

		self: A reference to the component that is invoking this function.
	self.props.selection.selectedRow = 0
	self.props.selection.selectedColumn = 'city'

You can figure this stuff out by playing with the table in the developer. I expected setting selectedRow would do the trick but it didn’t do anything until I selected a column as well. It was kind of obvious when I clicked in the table and saw both change in the PROPS view.