I’m trying to delete selected rows in the Ag-Grid table and after deletion update/refresh the Ag-Grid table. Also I would like to save the selected rows to the new DataFrame.
It that possible to do with just one button click (on click on the button the Ag-Grid table updates, deletes the selected rows and saves them to DataFrame)?
I changed your code appropriately for my case and it works!
However I still have two minor problems:
In order to delete the selected rows I must click on the -Row button twice
I want to change/edit the rows and when I remove them I want to save them into a DataFrame for further manipulation. This saving proccess is still causing me some problems.
Regarding the first point: It actually deletes the row after one click, however due to how I setup the logic, the grid isn’t reloaded immediately. Haven’t had the time to figure out a clever way to do this and instantly reload the grid.
And with regards to saving the changes, you can simply create a method that writes the grid['data'] to a new dataframe (or even the same dataframe).
However, it looks like Streamlit will be releasing some rather useful features for editable dataframes within this month, as per their roadmap.