Perspective Table - hyperlinked cells
M
Mason Taylor
Need a simple way to make the text inside perspective table cells into a hyperlink. I imagine the simplest way to add this would be to add options to the data property when using an array of objects. So in addition to specifying "value", "editable", and "style", each cell could have the keys "url"/"href" and "target", like the link component, to cause the cell to render as a hyperlink. Optimally, it would function exactly like the existing link component with a given URL. I am aware you can accomplish similar functionality by rendering columns as views. However, embedding a view into every table cell doesn't seem like it would be very scalable.
Log In
A
Arshia Ilaty
I hope I understand your question. I wrote this piece of code ondoubleclick scripting. So you will be able to double click on the cell and direct to the page.
if colName == "name":
Define the base URL
base_url = 'url'
Get the value of the clicked cell
clicked_value = self.data.getValueAt(rowIndex, colIndex)
Construct the complete URL by replacing the placeholder with the
clicked value
complete_url = base_url + str(clicked_value)
Open the URL in the default web browser
system.net.openURL(complete_url)