Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridUpdateMode.MANUAL with an external button #130

Closed
caryyu opened this issue Aug 11, 2022 · 1 comment
Closed

GridUpdateMode.MANUAL with an external button #130

caryyu opened this issue Aug 11, 2022 · 1 comment

Comments

@caryyu
Copy link

caryyu commented Aug 11, 2022

How can i use an external button to get all the selected rows when the update_mode is solely GridUpdateMode.MANUAL? The document says it will only draw a built-in one in the top of the table.

agg = AgGrid(..... update_mode=GridUpdateMode.MANUAL...)
selectedRows = agg['selected_rows'] # only until the external button is hit
@nathalieGG
Copy link

You can put your AgGrid in a form see the examples

import streamlit as st
import numpy as np
import pandas as pd

from st_aggrid import AgGrid, DataReturnMode, GridUpdateMode, GridOptionsBuilder

df_template = pd.DataFrame(
    '',
    index=range(10),
    columns=list('abcde')
)

with st.form('example form') as f:
    st.header('Example Form')
    response = AgGrid(df_template, editable=True, fit_columns_on_grid_load=True)
    st.form_submit_button()

st.write(response['data'])  ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants