Hi (first post so any improvements I can make please let me know).
I’m trying to make some cells in a data table non-editable. I realise there is a way to change the whole column but I only one a couple of cells at the bottom. Basically, the data is not a rectangle and thus these cells are not valid input. My initial thought was to try the styling but this didn’t work, as I suppose editable is not a css property but something dash defines. Any help or hints would be much appreciated.
dash_table.DataTable(
id="table",
columns=[
{"name": i, "id": i, "editable": j, "type": "numeric"}
for i, j in zip(
["Parameter", "Continuous", "Intermittent", "Peak"],
[False, True, True, True],
)
],
data=df.to_dict("records"),
style_table={"caret-color": "black"},
style_data_conditional=[
{
"if": {"column_editable": False}, # True | False
"backgroundColor": "rgb(240, 240, 240)",
},
{
"if": {
"filter_query": "{Continuous} = 0", # comparing columns to each other
"column_id": "Continuous",
},
"backgroundColor": "#3D9970",
"editable": False,
},
],
)