I’m using a dash_table.DataTable
to provide a way for users to enter data into several columns.
Some of these columns have dropdowns that are pre-populated, but I would like to allow the users to enter something different from the items in the dropdown.
I cannot get it to allow the user input. Whenever I type something different in, I get ‘No results found’, and it won’t accept the input.
Here’s my code. I believe I tried every permutation of on_change.action
and on_change.failure
and also tried to set the validation.default
as well, but I get the exact same behavior every time.
treatment_df = pd.DataFrame(columns=['number', 'control_type'])
for i in range(10):
treatment_df = treatment_df.append(pd.Series(), ignore_index=True,)
dt = dash_table.DataTable(
columns=[
{
"name": "number_of_plants",
"id": "number_of_plants",
"type": "numeric",
},
{
"name": "control_type",
"id": "control_type",
"presentation": "dropdown",
"on_change": {"action": "none", "failure": "accept"},
"type": "text",
"editable": True,
},
],
data=treatment_df.to_dict("records"),
editable=True,
row_deletable=True,
dropdown={
"control_type": {
"options": [
{"label": c, "value": c,} for c in CHOICES["control_types"]
]
},
},
style_table={"overflowX": "auto"},
style_cell={"fontSize": 12, "font-family": "sans-serif"},
)
return html.Div([html.H3("Treatments"), dt, html.Hr()])