I’m new to streamlit-aggrid. I have a CSV file I want to load to a dynamic table and allow editions to only some of the columns. I saw this example:
import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
df = pd.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6]})
grid_return = AgGrid(df, editable=True)
new_df = grid_return['data']
So I’ve followed it, but let’s say that instead of editable=True, that allows both col1 and col2 values to be modified, I want to allow modifications on one of them (not important which one).
How can I do that please? Thanks!
I tried to pass a columns subset into the editable args but it is only accepting boolean values.
Hi @secret, I had written a similar code (Ag-Grid component with input support - #236 by Shawn_Pereira) which you can refer to. However, this was for aggrid version 0.2.3. I currently use version 0.3.3. Between then and now there are changes in syntax. If you plan to test the code from the link and are using 0.3.3 then you need to make the following changes:
delete the line theme="streamlit",
Lines similar to dta['data']['Amt'][i] would now be dta['data'][i]['Amt']