Closed gyanendrasharma closed 2 years ago
@gyanendrasharma Have you figured it out how to add clickable hyperlinks in the table? I've same problem using it. Thanks!
@leonqli unfortunately, I couldn't and ended up using HTML tables instead. Would be definitely nice to have it though.
Thanks @gyanendrasharma!
Hi @gyanendrasharma ,
I figured out the following way may to insert hyperlink in ag-grid, in case you need it in the future.
from st_aggrid import JsCode
gb.configure_column("link",
headerName="Link",
cellRenderer=JsCode('''function(params) {return '<a href="https://www.google.com">params.value</a>'}'''),
width=300)
Awesome. Thanks @leonqli This should be helpful.
The example above is very useful - could we also incorporate each cell's data to the hyperlink?
Try to modify your code similar to the following way (you may need to change it to your URL):
cellRenderer=JsCode('''function(params) {return '<a href="https://www.google.com/' + params.value + '" target="_blank">'+ params.value+'</a>'}''')```
I was wondering if there was a way to have hyperlinks as cell entries in ag-grid through python alone. I am trying to display a table where the cell entries would be clickable links and I would like to accomplish this entirely through the python script. Is this something that is currently available or are there known solutions? Thank you!