Dash DataTable - Specify which columns should be editable

It is possible to make only a particular column editable and rest to remain uneditable?


This isn’t possible right now but it would be a good addition to the code. Perhaps we could allow editable to be a dict that maps column names / IDs to the boolean editable like:

editable={'column 1': True, 'column 3': False}

or perhaps we could allow columns to be a list of dictionaries that have all of the column-level properties like:

columns=[{'name': 'Column 1', 'editable': True, 'sortable': False, 'width': 50}, ...]

I would accept a pull request that thought through these options and implemented them. Here is the code: https://github.com/plotly/dash-table-experiments/blob/master/src/components/DataTable.react.js



I am using the Dash DataTable as both dynamic input and output fields. It would be really nice to have some way to specify which columns should/shouldn’t be editable in the way you suggested:

1 Like

Any updates on this feature? Thanks :slight_smile:

1 Like

Has this been added? I tried the dictionary, but does not seem to work, did you add it using different syntax, or do you still have to add it? - Thanks

Hello guys, is there some progress in this issue? I want to use “Dash data table”. I need to specify which columns could be editable. I have the same question like nelius. Thanks

Yes it is possible. See the editable reference in the Dash DataTable docs: https://dash.plot.ly/datatable/reference

I just figured out and I was about to post it here! [this doc is very difficult to read compared to other]

Can you give a working example of only allowing certain columns being editable?

From the reference: particular columns can be made editable by setting editable to True inside the columns property.

I tried a dictionary but everything is still editable
e.g. editable = {‘Col1’: False,‘Col2’:False, ‘Col3’:True}

You need to specify it in the columns :
my dt= dash_table.DataTable(
{‘name’: ‘columnNotEditable’, ‘id’: ‘index’, ‘editable’: False},
{‘name’: 'ColumnEditable ', ‘id’: ‘date’, ‘editable’: True},
# Other properties