tochoromero / aurelia-table

Simple functional data table for Aurelia
https://tochoromero.github.com/aurelia-table
MIT License
67 stars 25 forks source link

programatically select a row #40

Closed MECLab-Michelle closed 6 years ago

MECLab-Michelle commented 6 years ago

Hi,

On load I'd like to be able to programatically select the first row in the table. How would I go about doing this?

Cheers,

tochoromero commented 6 years ago

Hello there, behind the scenes when you click a row to select it a couple of things happen: 1) we set the $isSelected property to false on any other row if the selection mode is single. 2) We set the isSelected property to true for the clicked row 3) We trigger the selected custom event

You can pretty much do all of this in your own, and since you want to do this on load, all you really need to do is to set the $isSelected property in the desired element. If you need to know which one is the first one, you can do so checking the property you set to the display-data