Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D
### Added
- [#453](https://github.com/plotly/dash-ag-grid/pull/453) Test for changelog entry

### Changed
- [#452](https://github.com/plotly/dash-ag-grid/pull/452)
- Added test for `OBJ_MAYBE_FUNCTION_OR_MAP_MAYBE_FUNCTIONS` to test that the value is an object before parsing,
- this allows for reused keys to not comply with being an object


## [35.2.0] - 2026-04-03
### Added
Expand Down
34 changes: 18 additions & 16 deletions src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,24 +529,26 @@ export function DashAgGrid(props) {
});
}
if (OBJ_MAYBE_FUNCTION_OR_MAP_MAYBE_FUNCTIONS[target]) {
if ('function' in value) {
if (typeof value.function === 'string') {
return convertMaybeFunctionNoParams(value);
}
}
return map((v) => {
if (
typeof v === 'object' &&
v !== null &&
!Array.isArray(v)
) {
if (typeof v.function === 'string') {
return convertMaybeFunctionNoParams(v);
if (typeof value === 'object') {
if ('function' in value) {
if (typeof value.function === 'string') {
return convertMaybeFunctionNoParams(value);
}
return convertCol(v);
}
return v;
}, value);
return map((v) => {
if (
typeof v === 'object' &&
v !== null &&
!Array.isArray(v)
) {
if (typeof v.function === 'string') {
return convertMaybeFunctionNoParams(v);
}
return convertCol(v);
}
return v;
}, value);
}
}
if (
COLUMN_NESTED_FUNCTIONS[target] &&
Expand Down
28 changes: 27 additions & 1 deletion tests/test_cell_data_type_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dash_ag_grid as dag
from dash import Dash, html
import plotly.express as px
from . import utils

def test_cd001_cell_data_types_override(enforced_locale, dash_duo):
Expand Down Expand Up @@ -146,4 +147,29 @@ def test_cd002_column_types_formatting(dash_duo):
input_el = dash_duo.find_element("#grid-column-types .ag-input-field-input")
input_el.send_keys("0.2" + Keys.ENTER)

grid.wait_for_cell_text(0, 1, "0.200")
grid.wait_for_cell_text(0, 1, "0.200")

def test_cd003_column_types_overriding(dash_duo):
df = px.data.iris()

app = Dash(__name__)

app.layout = html.Div(
[
dag.AgGrid(
rowData=df.to_dict("records"),
columnDefs=[{"field": c} for c in df.columns],
dashGridOptions={
"dataTypeDefinitions": {
"number": {
"columnTypes": "rightAligned",
}
}
},
id='grid'
)
]
)

dash_duo.start_server(app)
grid = utils.Grid(dash_duo, "grid")
Loading