plotly/dash-ag-grid

Edit Cell Doesn't Work with Row Group and Application Assigned Row ID

brian-cawley opened this issue · 2 comments

Minimal Example:

import os
import dash_ag_grid as dag
from dash import Dash, html
import pandas as pd

app = Dash(__name__)

df = pd.DataFrame.from_records([
    dict(id='1', category='Cat1', name='Test1', value='Value1'),
    dict(id='2', category='Cat2', name='Test2', value='Value2'),
    dict(id='3', category='Cat2', name='Test3', value='Value3')

])

app.layout = html.Div(
    [
        dag.AgGrid(
            id='test-grid',
            enableEnterpriseModules=True,
            licenseKey=os.environ['AG_GRID_LICENSE'],
            rowData=df.to_dict('records'),
            getRowId='params.data.id',
            columnDefs=[
                dict(field='category', headerName='Category', rowGroup=True, hide=True),
                dict(field='name', headerName='Name'),
                dict(field='value', headerName='Value', editable=True),
            ]
        )
    ],
    style={"margin": 20},
)

if __name__ == "__main__":
    app.run_server(debug=True, host='0.0.0.0', port=8888)

After editing any of the Value cells, there is a console error. The grid appears to 'reset' (close all of the row groups) and a corresponding callback with Input('test-grid', 'cellValueChanged') has value None when it is triggered.

image

Hi @brian-cawley

I ran your test app but I can't reproduce the issue. Could you give more information please? What version are you running?

Hi @AnnMarieW,

Thanks for your response. I was using dash-ag-grid 2.2.0 (outdated). After upgrading to latest 2.4.0, I am no longer seeing this issue. Seems that this was fixed in 2.3.0 in relation to #215.