Add ROWS and COLUMNS to data table and automatically update in the database

HI.
I would like to know how we can add an extra row or column to an already existed table?

As a user I want to add a row or column to the data-table and it should be automatically updated in the database.
thank you in advance.

Hey there

In this guide (Editable DataTable | Dash for Python Documentation | Plotly), they have a few examples where they add COLUMNS and ROWS to an existing datatable. Because the table is ‘editable’, you can then change the value for each cell.

If you then want to update the database, I’d say your best bet would be to:

Add a button ‘Save’ (or any other text) that trigger a callback and uses the “data” of the datatable as STATE
The callback should CHECK the data (security and integrity). If data is OK, update database through your function

2 Likes

Thank you. I will try!

Regards,
Kittu

Hello Jordan,

I’m currently working on a similar project that would need this type of functionality, could you please show a working example of how you would go about your suggestion?