I am looking to get a Dash DataTable with in its first row a dropdown menu per column (see image below), in which the user can change the data type per column. The column names vary per dataset that the user uploads, but the dropdown options are fixed ([‘object’, ‘float64’…‘datetime64[ns]’])
I know from Dropdowns Inside DataTable | Dash for Python Documentation | Plotly that i can use the ‘dropdown’ parameter for this, but in their example their column names (=climate, temperature and city) are fixed, while mine are variable. How do I set dropdown options for a column name, which is unknown beforehand? Again, the image above shows exactly how I want the table to look.
code:
dropdown options = [option 1, option 2, option 3]
dash_table.DataTable(
featureTypeTable.to_dict('records'),
columns = [{"name": i, "id": i, 'presentation': 'dropdown'} for i in featureTypeTable.columns],
editable=True,
)