muonw / muonw-powertable

▦ PowerTable is a Svelte component that turns JSON data into an interactive HTML table. Inspired by DataTables. Powered by Svelte.
https://muonw.github.io/muonw-powertable/
Other
218 stars 13 forks source link

Simple Row Select #18

Closed kaijachmann closed 1 year ago

kaijachmann commented 1 year ago

Hi there, is there a possiblity to style the last clicked row with different background? The use-case is quite simple: click a row, now it should be highlighted somehow (background-color would be easiest), without further checkboxes visible. I could image, setting the selected index via prop would be nice, too.

Any hints?

Greetz Kai

muonw-public commented 1 year ago

Yes, there is a custom event that gives you the last clicked row:

https://github.com/muonw/powertable#events

Once you have the row element, you can style it using CSS.