I don’t know if it is possible, but I want to make an interactive dataframe in my application. In this sense, I’m using the streamlit aggrid, that is known for making possible to drag and drop columns of the dataframe (AgGrid — streamlit-aggrid 0.2.3 documentation). I’m trying to use the following commands to add the function to drag and drop rows.
Steps to reproduce
Code snippet:
import pandas as pd
import streamlit as st
from st_aggrid import AgGrid
from st_aggrid.grid_options_builder import GridOptionsBuilder
data_file = st.file_uploader("Upload CSV",type=["csv"])
if data_file is not None:
data_file = pd.read_csv(data_file)
gb = GridOptionsBuilder.from_dataframe(data_file)
gb.configure_side_bar()
gb.configure_default_column(rowDrag = True, rowDragManaged = True, rowDragEntireRow = True, rowDragMultiRow=True)
gb.configure_pagination(paginationPageSize=40)
gridOptions = gb.build()
data = AgGrid(data_file,
height=380,
gridOptions=gridOptions,
enable_enterprise_modules=True,
allow_unsafe_jscode=True,
paginationPageSize=10,
theme='streamlit'
)
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
I was expecting to be able to drag and drop rows of the output.
Actual behavior:
It actually drag the rows, but it don’t drop them, ie, the row stays in the place I took it. In this website React Data Grid: Row Dragging (ag-grid.com) there is an example that is exactily what I am aiming for.
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.