Black Lives Matter. Please consider donating to Black Girls Code today.

Dash-table cells not editable even when editable=True

I have been trying to use the NEW DASH TABLE :heart_eyes: . It’s been great but I am facing some issues. The table is not editable even though I have specified editable=True and the checkboxes aren’t selectable. Am I doing something wrong? I went through the documentation for the table but couldn’t have it figured.

. Please see the attached gif.


@app.callback(Output('fileListTable2', 'data'),
              [Input('fileInput', 'value')])
def fileListUpdate(fileInput):
    newlist = []
    datec = []
    datem = []
    if os.path.isdir(fileInput):
        fileList = os.listdir(fileInput)

        for names in fileList:
            if names.endswith(".txt") or names.endswith(".csv") or names.endswith(".xls") or names.endswith(".xlsx"):
                datec = os.path.getctime(os.path.join(fileInput, names))
                datem = os.path.getmtime(os.path.join(fileInput, names))
    tess = pd.DataFrame({'File Name': newlist,
                         'File Created': datetime.fromtimestamp(datec).strftime('%Y-%m-%d %H:%M:%S'),
                         'File Modified': datetime.fromtimestamp(datem).strftime('%Y-%m-%d %H:%M:%S')},
                        columns=['File Name', 'File Created', 'File Modified'])

    return tess.to_dict('records')


        columns=([{'name': 'File Name', 'id': 'File Name'}, {'name': 'File Created', 'id': 'File Created'},
                  {'name': 'File Modified', 'id': 'File Modified'}]),

I’ll create an issue if anyone can confirm that its a bug.

There’s a known bug where a lot of the client side functionality of the DataTable doesn’t work unless it’s connected as an input to at least 1 working callback, see:

Could be that?

1 Like

I see- great. Thank you very much. Let me try and update!

It works by including a callback. Thanks!

1 Like