I am using MATCH callback pattern for the following. In a tab I have a dropdown with list of dash tables displayed one below the other. So if user select one or more options from the dropdown, only those tables should be display and rest should be hidden. So i am using {‘display’: ‘none’} to hide the ones not in the dropdown selections. here is the callback below. It is working, but irrespective of how many selected only first one is displayed. Can someone point what mistake I am making here?
@app.callback(Output({'type': 'table-and-search-display-alltab', 'index': MATCH}, 'style'),
[Input({'type': 'table-and-search-display-alltab', 'index': MATCH}, 'id'),
Input('all-dataset-drop-down', 'value')
])
def show_specific_datasets(alltables, search_dsets_showlist):
if search_dsets_showlist is not None and len(search_dsets_showlist) > 0:
for srcdset in search_dsets_showlist:
# Maching the selection value to the table index.
if int(srcdset.split('_')[0]) == alltables['index']:
return no_update
else:
return {'display': 'none'}