How to Highlight a Selected Row in n-data-table? #5294
-
Hello everyone, I'm currently working on a project using Naive UI's n-data-table component. I'm trying to highlight a selected row when a user clicks on it. I've tried using the row-props attribute to dynamically set the class of the row, but I'm encountering issues. Here's a snippet of what I've tried:
I've also tried using the rowClassName attribute, but it only triggers on load and not when a row is selected. Has anyone successfully implemented row highlighting in n-data-table? Any guidance or suggestions would be greatly appreciated! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! The code below creates the ability to select (checkbox) a table row by clicking on any cell. You can modify it to highlight by adding HTML classes directly to the selector of the cell row of the table
|
Beta Was this translation helpful? Give feedback.
Hi!
The code below creates the ability to select (checkbox) a table row by clicking on any cell.
You can modify it to highlight by adding HTML classes directly to the selector of the cell row of the table