I know this is very old, but I could not find a newer version of the question anywhere else, and the answer above from ferr solved the problem for me, but is not very clear, so I thought I was updating it.
It is assumed that you want to use the ID in the output HTML (for example, inside a link), I think this is quite common.
Using javascript from the pathtosharepoint link, I added the following to get an identifier with an if statement for security:
if (HTMLregexp.test(CellContent)) { //original pathtosharepoint line if (NodeSet[i].parentNode.getAttribute("iid")){ var SPID = NodeSet[i].parentNode.getAttribute("iid").split(",")[1]; CellContent = CellContent.replace("SPIDReplace", SPID) } NodeSet[i].innerHTML = CellContent; //original pathtosharepoint line
This is placed in the while loop of the last pathtosharepoint fix at the time of writing. This works for me in SharePoint 2010. Note: Include the string "SPIDReplace" in the computed column to replace it with the element identifier.
pathtosharepoint page: http://blog.pathtosharepoint.com/category/calculated-columns/ pathtosharepoint code: http://pathtosharepoint.com/Downloads
user4664104
source share