You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Grid does not render when getRowId is explicitly set to None #417
(This error originated from the built-in JavaScript code that runs Dash apps. Click to see the full stack trace or open your browser's console.)
TypeError: t is not a function
at http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:1:15220
at Io.setId (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:50:29517)
at Io.setDataAndId (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:50:28743)
at U1.createNode (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:189:58137)
at http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:189:54575
at Array.map (<anonymous>)
at U1.setRowData (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:189:54559)
at sv.setRowData (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:189:72154)
at sv.setInitialData (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:189:61883)
at sv.start (http://127.0.0.1:8050/_dash-component-suites/dash_ag_grid/async-community.js:189:61771)
This seems like an upstream issue with how AG Grid renders. While we can make a workaround in the code, there is no default value passed to the grid, and never was.
Could you please elaborate why you are setting the getRowId to None?
The default value of None is in the generated python ag grid constructor. As a python developer, I find it very unintuitive that it behaves differently based on whether the default argument is specified explicitly or not (I'm guessing it leads to some null vs undefined difference in js).
As for why we are setting it to None, we have a wrapper around the ag grid constructor which which takes care of setting a lot of the args that we want to be the same every time (some styling, event listeners, default col def etc.), and this wrapper has the get_row_id as an optional argument.
I see the issue is with what the typing is placing, what is passed to the grid when you set a grid can be seen by using the to_plotly_json(), this will show the real default values:
from dash import Dash
import dash_ag_grid as dag
grid = dag.AgGrid(
rowData=[{"test": 1}],
columnDefs=[{"field": "test"}],
)
print(grid.to_plotly_json())
layout = [
grid,
]
app = Dash(__name__)
app.layout = layout
app.run(debug=True)
As far as undefined I find it counter intuitive to define something as undefined. But you are welcome to submit a PR on the dash repo to allow for the setting of an undefined value to a prop.
Also, going back to your example, I am a little confused but the getRowId which is the subject of the issue, but the example you provided is using getRowStyle. But I'm assuming the concept is the same... yes, you shouldnt pass a key to the grid unless it can handle a null in the upstream AG Grid.
Activity
BSd3v commentedon Dec 1, 2025
Hello @tlauli,
This seems like an upstream issue with how AG Grid renders. While we can make a workaround in the code, there is no default value passed to the grid, and never was.
Could you please elaborate why you are setting the
getRowIdtoNone?tlauli commentedon Dec 1, 2025
The default value of None is in the generated python ag grid constructor. As a python developer, I find it very unintuitive that it behaves differently based on whether the default argument is specified explicitly or not (I'm guessing it leads to some
nullvsundefineddifference in js).As for why we are setting it to
None, we have a wrapper around the ag grid constructor which which takes care of setting a lot of the args that we want to be the same every time (some styling, event listeners, default col def etc.), and this wrapper has theget_row_idas an optional argument.We can workaround this like
but this does not play well with static typecheckers and is hard to read.
This is perhaps a symptom of a larger (in scope) issue with dash, and that is the inability to express the
undefinedjs value.EDIT:
get_row_stylefixed toget_row_idBSd3v commentedon Dec 2, 2025
I see the issue is with what the typing is placing, what is passed to the grid when you set a grid can be seen by using the
to_plotly_json(), this will show the real default values:As far as
undefinedI find it counter intuitive to define something asundefined. But you are welcome to submit a PR on the dash repo to allow for the setting of anundefinedvalue to a prop.Also, going back to your example, I am a little confused but the
getRowIdwhich is the subject of the issue, but the example you provided is usinggetRowStyle. But I'm assuming the concept is the same... yes, you shouldnt pass a key to the grid unless it can handle anullin the upstream AG Grid.tlauli commentedon Dec 2, 2025
There should be
get_row_id, I mistyped, edited the comment.undefinedmay not be the best name, I agree, possibly something asno_valuewould be better.When I have time I will make a new issue in the dash repo with the description of the problem and my proposed solution, and then try to implement it.