Open modal on click of DataGrid row

I have a DataGrid.

On click of a specific row, I want a modal to show with information specific to that row.

First, I tried using the select column to initiate an “On click” state, which records the “” in a variable called “clickedRow.”

However, the “clickedRow” variable does not record the “” when checking the variable in the side panel.

I tried the same when clicking on a particular cell, but receive the same results.

I figured it out.

Set the “clickedRow” variable to type object.
On click, partial update the “clickedRow” variable with and set the value also as the
Then you will have the row id store as a key:value pair and can manipulate accordingly.

1 Like

Nicely done! :raised_hands:

1 Like