# In Ag-Grid: using selected row after clicked cell

**URL:** <https://community.plotly.com/t/in-ag-grid-using-selected-row-after-clicked-cell/96887>\
**Category:** Dash Python\
**Created:** [April 30, 2026, 1:21pm UTC](https://community.plotly.com/t/in-ag-grid-using-selected-row-after-clicked-cell/96887 "2026-04-30T13:21:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuriAoto](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/yuriaoto/32/32408_2.png) [@YuriAoto](https://community.plotly.com/u/YuriAoto)\
**Post date:** [April 30, 2026, 1:21pm UTC](https://community.plotly.com/t/in-ag-grid-using-selected-row-after-clicked-cell/96887/1 "2026-04-30T13:21:04Z")

</div>

Dear all,

I have the following dilemma regarding best practice and data safety:

Often I have a modal being open after a double click on an AGgrid. After the user interacts with the modal and submits (say, for changing some contents in a more complex way that I think is better via modal than cell editing), I want to have the full AGGrid row (often to make a transaction update to the Grid, with updated values).

However, I feel that using selectedRow as state in the submit callback may lead to some data corruption, as the row was not “just selected” …

So, my approach: I create the modal in a clientside callback, use the gridApi to access the row, and Store the row data in the modal. The data in this Store that I then use in the submit callback ;

What do you think? Should I simply use the rowData directly??

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [April 30, 2026, 2:20pm UTC](https://community.plotly.com/t/in-ag-grid-using-selected-row-after-clicked-cell/96887/2 "2026-04-30T14:20:18Z")

</div>

Hello @YuriAoto

If you give the grid a getRowId that is unique, you can use a rowTransaction update once the form is submitted.

---

<div class="post-metadata">

**Author:** ![YuriAoto](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/yuriaoto/32/32408_2.png) [@YuriAoto](https://community.plotly.com/u/YuriAoto)\
**Post date:** [April 30, 2026, 2:45pm UTC](https://community.plotly.com/t/in-ag-grid-using-selected-row-after-clicked-cell/96887/3 "2026-04-30T14:45:56Z")

</div>

Hello @jinnyzor

Thanks for the reply;

Ok, but if I have several columns, say a row data with fields:

{rowId, col1, col2, col3}

but at the moment of submitting the form I know only few of them, because the whole row data is not given at the double click callback. I thus have only col1 and rowId, for instance, if I double clicked at col1. If I return a transaction with

{‘update’: [{‘rowId’: knownRowID, ‘col1’: new\_value}]}

the data at columns col1 and col2 are lost. So, as far as I can see, I have to do something like

original\_row[‘col1’] = new\_value

{‘update’: [original\_row]}

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [April 30, 2026, 3:04pm UTC](https://community.plotly.com/t/in-ag-grid-using-selected-row-after-clicked-cell/96887/4 "2026-04-30T15:04:44Z")

</div>

You can use the `selectedRows` as you mentioned and update, the `getRowId` will maintain the selection even after the update as well.
