Hello,
I am facing an odd issue where it seems my tool tips stopped working on my aggrid. I’m still using streamlit-aggrid v0.3.4post3 with streamlit v1.27.2 so that has not changed. Below is a snippet of code that I am trying to run to prove out that tooltips are still working.
Not sure what I am doing wrong?
d = {'Review': ["Good", "Bad", "Average"], 'Name': [2, 22, 23]}
df = pd.DataFrame(d)
df.columns = ["Review", "Name"]
gb = GridOptionsBuilder.from_dataframe(df)
gb.configure_column(
"Review",
editable=False,
minWidth=200,
tooltipField="Review",
tooltipComponent=JsCode("""
class CustomTooltip {
eGui;
init(params) {
const eGui = (this.eGui = document.createElement('div'));
const color = params.color || 'black';
const data = params.api.getDisplayedRowAtIndex(params.rowIndex).data;
eGui.classList.add('custom-tooltip');
//@ts-ignore
eGui.style['background-color'] = color;
eGui.style['color'] = 'white';
eGui.style['padding'] = "5px 5px 5px 5px";
eGui.style['font-size'] = "15px";
eGui.style['border-style'] = 'double';
this.eGui.innerText = data.Review;
}
getGui() {
return this.eGui;
}
}""")
)
options = gb.build()
AgGrid(
df,
gridOptions=options,
key="test_aggrid",
enable_enterprise_modules=False,
allow_unsafe_jscode=True
)