Hello again. I’ve come to understand more about python and dash, but still a beginner and a longs way to go.
I have this:
@app.callback(
Output("store", "data"),
Output("text", "value"),
Input("addbox", "n_clicks"),
State("cikinput", "value"),
State("store", "data"),
)
def store_data(n_clicks, oval, data):
ctx = dash.callback_context
input_id = ctx.triggered[0]["prop_id"].split(".")[0]
if input_id == "addbox":
data[n_clicks] = oval
return data, dash.no_update
else:
return dash.no_update, data.get(oval, "")
which returns this:
[{‘0’: ‘CIK0000832988.csv’, ‘1’: ‘CIK0000832988.csv’}]
I think that’s called an array?
But from this snippet:
@app.callback(
Output("store", "data"),
Output("dropdown", "value"),
Input("text", "value"),
Input("submit", "n_clicks"),
State("dropdown", "value"),
State("store", "data"),
)
def update(text_value, n_clicks, op_value, data):
ctx = dash.callback_context
input_id = ctx.triggered[0]["prop_id"].split(".")[0]
if input_id == "submit":
data[n_clicks] = op_value
return data, dash.no_update
else:
return dash.no_update, data.get(text_value, "")
returns it like this:
{‘0’: ‘abc’, ‘1’: ‘xyz’}
How can I control this? I can’t figure out how.
Thank you