vizro
vizro copied to clipboard
AgGrid doesn't work with `persistence` props
Description
Not sure if this has been discussed before, but the persistence
props do not work with the AgGrid in Vizro, while they work fine in a pure dash app.
Expected behavior
I would expect the persistence
props to work as expected, but currently they do not seem to have an effect e.g. when configuring the persistence props, the inserted values still get lost after refreshing the page.
On another note, I think they should also be turned on as default for the dash_ag_grid
function (similar how we turn it on automatically for the other components).
Which package?
vizro
Package version
0.1.14
Python version
3.9
OS
How to Reproduce
- Run the code below with the latest vizro version
- Insert a value inside the floatingFilter
- Refresh the page
"""Example to show dashboard configuration."""
import vizro.models as vm
import vizro.plotly.express as px
from vizro import Vizro
from vizro.tables import dash_ag_grid
df = px.data.gapminder()
page = vm.Page(
title="Enhanced AG Grid",
components=[
vm.AgGrid(
title="Dash AG Grid",
figure=dash_ag_grid(
data_frame=df,
columnDefs=[
{"field": "country", "floatingFilter": True, "suppressMenu": True},
{"field": "continent", "floatingFilter": True, "suppressMenu": True},
{"field": "year"},
{"field": "lifeExp", "cellDataType": "numeric"},
{"field": "pop", "cellDataType": "numeric"},
{"field": "gdpPercap", "cellDataType": "euro"},
],
persistence=True,
persisted_props=["filterModel"]
),
),
],
controls=[vm.Filter(column="continent")],
)
dashboard = vm.Dashboard(pages=[page])
if __name__ == "__main__":
Vizro().build(dashboard).run()
Output
No response
Code of Conduct
- [X] I agree to follow the Code of Conduct.
This is part of the backlog, but not prioritised for this sprint: https://github.com/McK-Internal/vizro-internal/issues/660. Would propose closing either due to duplication, which one is preferable?
I would leave this issue open so it's visible to OS users, as I am sure some will face the same issues especially if they use options such as the floatingFilter
etc.
Can we close this now? @petar-qb
Yes, we can close it since this bug is fixed with https://github.com/mckinsey/vizro/pull/644.