PablocFonseca / streamlit-aggrid

Implementation of Ag-Grid component for Streamlit
https://pypi.org/project/streamlit-aggrid/
MIT License
1.05k stars 199 forks source link

Bug: deprecated update_mode argument is still being used and will override update_on #167

Closed gregd33 closed 6 months ago

gregd33 commented 1 year ago

So update_on is the parameter we are supposed to use. It is optional and set to [] so that the grid never updates.

update_mode is deprecated and optional but the default is GridUpdateMode.MODEL_CHANGED which is equivalent to VALUE_CHANGED | SELECTION_CHANGED | FILTERING_CHANGED | SORTING_CHANGED.

Since update_mode is still parsed, it will then set update_on=[ "cellValueChanged","selectionChanged","filterChanged","sortChanged"] which is not expected and I suspect unintended since update_on=[] by default. Even if you specify update_on with custom values, these will be added.

I think that update_mode should be set to None by default so that the default behaviour is the same as update_on. Then users can use either.

As a workaround for now, ensure that both update_on and update_mode reflect the same behaviour.