Closed joonh-min closed 1 year ago
@hieut91 Thanks for reporting - this looks like a bug.
Nice minimal example too - that's helpful :slightly_smiling_face:
Hello @hieut91,
I actually am already working on this. 😄
Should have a PR here today that will address this concern.
@AnnMarieW @BSd3v That's awesome, Thanks a lot!
Hello @hieut91, this is available now in a3. 😄
Please reopen if there is an issue.
@BSd3v yup, they work as I expected, Thank you!👍
Hello, thanks for your works.
I've been working with a table with multiple layers of columns, like years, quarters, months, and so on.
I was exporting formatted numbers as string, but I saw that
valueFormatter
is available from a2, I wanted try it. but it seems like I won't able to get thevalueFormatter
working from 2nd level.Would there be a way for me to get the
params.value
within those groups?I just made a quick example from this.
Example
``` import dash_ag_grid as dag from dash import Dash, html, dcc import plotly.express as px df = px.data.gapminder() app = Dash(__name__) columnDefs = [ {"headerName": "Country", "field": "country", "flex":1}, {"headerName": "Continent", "field": "continent", "flex":1}, {"headerName": "Year", "field": "year", "flex":1}, {"headerName": "grouped", "flex":1, "groupId":"group1", "children": [ { "headerName": "Population", "field": "pop", "flex":1, "valueFormatter": {"function": "d3.format(',.0f')(params.value)"}, }, { "headerName": "GDP per Capita", "field": "gdpPercap", "flex":1, "valueFormatter": {"function": "d3.format('$,.1f')(params.value)"}, }, { "headerName": "group2", "groupId":"group2", "flex":1, "children":[ { "headerName": "Life_Expectancy", "field": "lifeExp", "flex":1, "valueFormatter": {"function": "d3.format(',.0f')(params.value)"}, }, { "headerName": "GDP per Capita2", "field": "gdpPercap", "flex":1, "valueFormatter": {"function": "d3.format('$,.1f')(params.value)"}, }, ] }, ] } ] app.layout = html.Div( [ dcc.Markdown("Gapminder Data with formatting"), dag.AgGrid( columnDefs=columnDefs, defaultColDef="", rowData=df.to_dict("records"), columnSize="sizeToFit", ), ], style={"margin": 20}, ) if __name__ == "__main__": app.run(debug=True) ```I hope I am just missing something, Thanks for the works once again!