There are 2 different dropdowns to create 2 seperate datatables.
They simply filter queries by date.
#Table1
@app.callback(
Output('d_signals', 'children'),
Input('dropdown1', 'value'))
def d_signals(date_value):
#Table2
@app.callback(
Output('d3_signals', 'children'),
Input('dropdown2', 'value')
)
def d3_signals(date_value):
And I also use these dropdowns to filter another type of query and create 2 more new datatables.
#Table3
@app.callback(
Output('daily_strongs', 'children'),
Input('dropdown1', 'value')
)
def daily_strongs(date_value):
#Table4
@app.callback(
Output('3d_strongs', 'children'),
Input('dropdown2', 'value')
)
def days3_strongs(date_value):
And finally I use them to create another datatable with another query.
#Table5
@app.callback(
Output('signals_int', 'children'),
[Input('dropdown1', 'value'),
Input('dropdown2', 'value'),
])
def corners_matrix(dv1,dv2):
Now I want to use selected_rows from #Table3 and #Table4 to match and filter #Table5 so that i can compare them.
I change the final callback with this:
@app.callback(
Output('signals_int', 'children'),
[
Input('dropdown1', 'value'),
Input('dropdown2', 'value'),
],
[
Input('d-strongs', 'selected_rows'),
Input('d3-strongs', 'selected_rows'),
],
[
State('d-strongs', 'data'),
State('d3-strongs', 'data'),
],
)
def corners_matrix(dv1,dv2,dsr,d3sr,dt,d3t):
It works. However I keep getting this error:
A nonexistent object was used in an Input
of a Dash callback. The id of this object is d-strongs* and *A nonexistent object was used in an
Inputof a Dash callback. The id of this object is
3d-strongs
FYI, I have included these ids( at the callbacks functions of Table 3 and Table 4 so thats how it works.
I tried everyting to stop this like generating an empty datatable for the 5th table in the layout. also seperating functions to update 5th table doesnt work.
Here is the layout:
app.layout = html.Div(
[
dbc.Row(
[
dbc.Col([
dbc.Row([
dbc.Col(
html.Div(
dcc.Dropdown(
id='dropdown1',
options=[{'label': i, 'value': i} for i in df_dh],
value=df_dh.iloc[0],
placeholder=df_dh.iloc[0],
clearable=False)
),
),
dbc.Col(
html.Div(
dcc.Dropdown(
id='dropdown2',
options=[{'label': i, 'value': i} for i in df_3dh],
value=df_3dh.iloc[0],
placeholder=df_3dh.iloc[0],
clearable=False)
),
),
]),
]),
]
),
dbc.Row(
[
dbc.Col([
dbc.Row([
dbc.Col(
html.Div(id='d_signals', children=[]),
),
dbc.Col(
html.Div(id='d3_signals', children=[]),
),
]),
]),
dbc.Col(
[
html.Div(id='daily_strongs', children=[]),
html.Div(id='3d_strongs', children=[]),
]
),
dbc.Col(
html.Div(id='signals_int', children=[]),
),
]
),
]
)
Many thanks in advance.
Regards.