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

How to ADD rows to uploaded dash table?

I uploaded the dash table and now I want to add rows to it and save it back to the database.

can anyone please help me from this problem?


1 Like

You can read the documentation that mentions adding rows.

    Output('adding-rows-table', 'data'),
    [Input('editing-rows-button', 'n_clicks')],
    [State('adding-rows-table', 'data'),
     State('adding-rows-table', 'columns')])
def add_row(n_clicks, rows, columns):
    if n_clicks > 0:
        rows.append({c['id']: '' for c in columns})
    return rows
1 Like

That does not work when the table is created by another callback though.