hi.
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?
regards,
Kittu.
hi.
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?
regards,
Kittu.
You can read the documentation https://dash.plot.ly/datatable/editable that mentions adding rows.
@app.callback(
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
That does not work when the table is created by another callback though.