Hi,
I am using an Ag-Grid table in my app and it resets to the original full data set after I apply a filter. The behaviour is a bit unusual because I am using Ag-Grid tables on two other pages with identical code (the only difference is the name of the .sql
file that is being referenced to pull the data from a big query database). The table is working correctly and not resetting on those two pages.
I am not able to understand why the table is not working as expected on this specific page. I believe the SQL code should have no impact on the behaviour of the Ag-Grid table.
Here is the section of the code that is building the Ag-Grid table -
gb = GridOptionsBuilder.from_dataframe(df)
gb.configure_pagination(paginationAutoPageSize=True) # Add pagination
gb.configure_side_bar() # Add a sidebar
gb.configure_selection("multiple", use_checkbox=False) # Enable multi-row selection
gridOptions = gb.build()
grid_response = AgGrid(
df,
gridOptions=gridOptions,
data_return_mode="FILTERED", # options ->AS_INPUT, FILTERED
update_mode="GRID_CHANGED", # options -> GRID_CHANGED, SELECTION_CHANGED, MODEL_CHANGED, MANUAL
fit_columns_on_grid_load=False,
theme="alpine", # Add theme color to the table Available options: ['streamlit', 'alpine', 'balham', 'material']
enable_enterprise_modules=True,
height=500,
width="100%",
reload_data=False,
allow_unsafe_jscode=False,
)
data = grid_response["data"]
df1 = pd.DataFrame(data)
Does anyone have any ideas? Please let me know if I should provide any more information. Thanks.