I posted Creating an Aggrid with columns with embedded URLs
It was resolved. However, I thought the root of the problem is version of streamlit-aggrid.
Example Code:
import streamlit as st
from st_aggrid import AgGrid, GridOptionsBuilder, GridUpdateMode
from st_aggrid.shared import JsCode
import pandas as pd
data = {
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35],
"link": [
"https://example.com/alice",
"https://example.com/bob",
"https://example.com/charlie",
],
}
df = pd.DataFrame(data)
gb = GridOptionsBuilder.from_dataframe(df,
editable=True)
cell_renderer = JsCode("""
function(params) {return `<a href=${params.value} target="_blank">${params.value}</a>`}
""")
gb.configure_column("link",
headerName="Link",
cellRenderer=cell_renderer,
width=100)
grid = AgGrid(df,
gridOptions=gb.build(),
updateMode=GridUpdateMode.VALUE_CHANGED,
allow_unsafe_jscode=True)
output with streamlit-aggrid version 0.3.2 is
This is what I want.
On the other hand, if I use streamlit-aggrid version 0.3.4, the result is
Does anyone have same issue?
(Python version is 3.10)