Has anyone using the ag-grid custom component gotten a copy-paste functionality working that works the way users expect? I’ve set editable=True in the configure_default_column function to enable copying cells, but I think users would like to be able to copy and paste a table into another destination, probably as html. But do any of you have a solution you can share/discuss?
Thanks Pablo for the tips/link, and of course thanks for the wonderful component in the first place!
Ok, I’ve added that and changed the default column config a bit. With what I have I am able to copy/paste single cells, but I can’t even select multiple cells. So it looks like:
gb.configure_default_column(groupable=True,
value=True,
enableRowGroup=True,
editable=True,
enableRangeSelection=True,
)
# Column configs
gb.configure_column("columns",
headerName="http link",
cellRenderer=http_renderer,
width=100)
gb.configure_column("of",
headerName="Count",
type=["numericColumn", "numberColumnFilter"],
width=50)
gb.configure_column("data",
headerName="Percent Match",
cellRenderer=percentage_renderer,
type=["numericColumn", "numberColumnFilter"],
width=50)
gridOptions = gb.build()
AgGrid(
grid_df[['columns', 'of', 'data']],
gridOptions=gridOptions,
fit_columns_on_grid_load=True,
height=800,
enable_enterprise_modules=True,
allow_unsafe_jscode=True # Set to True to allow JsCode to be injected
)
I suspect I am missing something - do I need to implement JsCode handlers for the clipboard events like the examples on the AgGrid page? Or maybe I don’t have enterprise features set up properly?
I have faced same issue what cannot select multiple rows. I tried gb.configure_selection(selection_mode=‘multiple’) which allows to click whole row instead of each row. Did you fix this issue yourself?
I added gb.configure_grid_options(enableRangeSelection=True) and it allows to multiselect. but streamlit is always refresh once copy and paste the data.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.