I have been trying to get conditional dropdowns to work in a datatable, but the options in the dropdown columns don’t load properly. Each cell will show an arrow for a dropdown, but when clicked nothing will show up.
Here is the code for the datatable:
dtb.DataTable(id='conditional_column_dropdown_experiments',
data=df.to_dict('records'),
columns=[
{'name': col, 'id': col, 'type': 'dropdown'}
for col in cols
],
editable=True,
column_conditional_dropdowns=[
{
'id': col,
'dropdowns': [
{
'condition': 'index eq "{}"'.format(val),
'dropdown': [
{'label': i, 'value': i}
for i in list(range(5))
]
}
for val in index_val]
}
for col in cols if col != 'index'
]
)
Where cols and index_val are lists generated from the dataframe where the dropdowns are necessary.
I have tied the table to a basic callback, but there is still no luck rendering the dropdowns.
Although I am responding to an old post, I am having the same issue: the dropdown menus within a DataTable show an arrow, but no options when clicked. Initially, I assumed the problem was with my code (as I am dynamically assigning the dropdown_conditional property from a callback, as described here and links therein). But when I examined the relevant nodes in the Callback Graph, I could see it was being populated correctly.
From this, I assumed the problem was related to my dev environment. So I tried running the DataTable with Per-Row Dropdowns example code in the DataTable documentation.
I am seeing the same behavior with the example; the dropdowns are there, but the options don’t populate.
I found the current thread after that; I don’t know what the “Bootstrap 4” reference is to. I rebuilt my environment (running in Docker) without version constraints to try to get the latest of everything; I am running dash-bootstrap-components 1.3.1. Otherwise, I am running Python version 3.9.12 (on an Ubuntu 18 docker image), with these packages:
Thanks for your help-- very much appreciated! This fixed the demo code immediately. Unfortunately, it took me a while longer to get my own dropdowns working. Even after implementing your fix, I had some style properties set that were preventing the dropdowns from rendering, specifically:
…seem to have been the culprits. This is what I get for copying code from another app without fully understanding it! I wish these types of issues were mentioned in the official documentation though.