Hello,
I have the following code, on the old man there is a panel that changes the set of functions (buttons) depending on an external factor, at the moment I encountered the following error,
please, tell me how you can solve it
error: A nonexistent object was used in an Input
of a Dash callback.
### Here switch betwen s and m groupby panel
@app.callback(Output('control-panel', 'children'),
Input('switch_s_m', 'value'),
)
def panel_groupby(m_s):
if m_s == 'm':
return html.Div([
html.Label('Detalied', className="active", id="list"),
html.Label('Group by Date', id="group_date"),
html.Label('Group by G', id="group_g")
], className="groupby")
elif m_s == 's':
return html.Div([
html.Label('Detalied', className="active", id="list"),
html.Label('Group by Date', id="group_date"),
html.Label('Group by Network', id="group_net"),
html.Label('Group by Country', id='group_country'),
html.Label('Group by G', id='group_g')
], className="groupby")
@app.callback(Output('table', 'children'),
[Input('list', 'n_clicks'),
Input('group_date', 'n_clicks'),
Input('group_g', 'n_clicks'),
Input('from_date', 'date'),
Input('end_date', 'date'),
Input('url', 'pathname'),
Input('switch_sms_msu', 'value'),
Input('group_net', 'n_clicks'),
Input('group_country', 'n_clicks')]
)
def table_detalied(n_all, n_date, n_gt, start_d, end_d, pathname, type, net, contr):
two control panels have a common set of functions and the second two additional
it general:
[Input('list', 'n_clicks'),
Input('group_date', 'n_clicks'),
Input('group_g', 'n_clicks'),
and addition on of the second
Input('group_net', 'n_clicks'),
Input('group_country', 'n_clicks')]