After many tries, i can’t figure out why, but any target for this callback’s output will return a key_error.
Layout :
...
app = DjangoDash('liste_app', serve_locally=True)
app.layout = ...
...
...
html.Div(className='card-body',
children=[
dcc.Store(id='sorted_storage', data=''),
html.P(children=['filler text'],
id="sorted_liste", style={'overflow': 'scroll',
'height': '100px'})
])
...
Callback
@app.expanded_callback(
[Output('sorted_storage', 'data')],
[Input('insert', 'n_clicks')],
[State('tabs', 'value')]
)
def insertSortButton(n_clicks, value, **context):
if n_clicks is not None:
liste = get_int_liste(context['request'].session.session_key, int(value))
sorted_liste, time = insertSort(liste)
save_algo_result(sorted_liste, time, context['request'].session.session_key, int(value), 'insert')e
else:
sorted_liste = 0
return sorted_liste
Error :
File "D:\Projets\Python\Exercices\Algorithmique\venv\lib\site-packages\django_plotly_dash\dash_wrapper.py", line 620, in dispatch_with_args
for component_registration in self.callback_map[target_id]['inputs']:
KeyError: 'sorted_storage.data'