Hi @Neil_H
You can find an example of updating columns in a callback here:
If you want to update the rows based on external filters such as dropdowns, you can sort or filter the data in a callback and return it to the grid’s rowData
prop
Hi @Neil_H
You can find an example of updating columns in a callback here:
If you want to update the rows based on external filters such as dropdowns, you can sort or filter the data in a callback and return it to the grid’s rowData
prop
Thank you guys, this is helpful, will update on progress in a little while.
Just to loop back, incase anyone else is wondering the same thing (updating ag grid data rows based on one or multiple dropdowns or other inputs; for changing columns, refer to to AnnMarieW’s link above).
@app.callback(
Output('aggrid', 'rowData'),
Input(component_id = 'dropdown1', component_property = 'value'),
Input(component_id = 'dropdown2', component_property = 'value'))
def select_grid_data(dropdown1_value, dropdown2_value):
if dropdown1_value == "process 1":
if dropdown2_value == 'date 1':
return process1_date1_data
if dropdown2_value == 'date 2':
return process1_date2_data
elif dropdown1_value == "process 2":
if dropdown2_value == 'date 1':
return process2_date1_data
if dropdown2_value == 'date 2':
return process2_date2_data
Note: this is a quick / dirty way on how I’m updating the rowdata prop for ag grid for testing - I realize nested IF statements is not ideal, I plan to use the input values to filter a dataframe or another more cleaner method.
A post was split to a new topic: Ag Grid with Multi page apps
Not sure if it’s a proper place to ask troubleshooting questions about the Dash Ag Grid component, but i’m struggling with a value getter. Is working with dates supported? both
valueGetter= {“function”: “Date();”} and valueGetter= {“function”: “new Date();”}, return nothing, and no error is thrown. I can use d3.isoParse(params.my_column), but I actually need to compute a number of days from today till that specific date. But d3 does not seem to have a function to return current date, so I’m stuck.
@fingoldo
Can you please create a new post with this question, instead of adding it here in this long thread?