Row ID / selected row #210
-
First off, great component, MUCH better than most options out there. Is there any way of adding event handling on row click? I want to load a new page based on the id of the selected / clicked row. Almost like stickyRightColumn but I can't for the life of me work out how to pass the selected row to a custom handler. I can get the id if the data is edited first...but how do I get the ID (or whole row) on 'rowClick'? |
Beta Was this translation helpful? Give feedback.
Answered by
nick-keller
Nov 14, 2022
Replies: 2 comments
-
Hey @Dee66 ,
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nick-keller
-
That's perfect!
onActiveCellChange gives me the row ID, I can use that to do a lookup on
the grid data and trigger the page load.
Can't say I've got 'selected' to work but the cell change works a treat.
Thanks bro 👌
…On Mon, 14 Nov 2022 at 18:30, Nicolas Keller ***@***.***> wrote:
Hey @Dee66 <https://github.com/Dee66> ,
1. You can add a key selected: true to the row object itself. You can
then use it to add custom class to the row, show a checkbox in the gutter,
you name it...
2. You can also use the onActiveCellChange
<https://react-datasheet-grid.netlify.app/docs/api-reference/props#onactivecellchange>
prop to know when the active cell (the highlighted cell) changes
—
Reply to this email directly, view it on GitHub
<#210 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB76KKCUVDBRNRQTHG6YVU3WIJSKXANCNFSM6AAAAAAR72XHWU>
.
You are receiving this because you were mentioned.Message ID:
<nick-keller/react-datasheet-grid/repo-discussions/210/comments/4138620@
github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @Dee66 ,
selected: true
to the row object itself. You can then use it to add custom class to the row, show a checkbox in the gutter, you name it...