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.