If you have specified a JSLink for your list view, how do you get the URL to the list item from within your rendering function? By URL, I mean a URL that can be used to view/display the list item.
If you look at the properties of the renderingContext.CurrentItem object, you will see that there isn’t anything that will give you the URL.
If you look at the properties of the renderingContext object itself, you will see that there are three relevant properties: displayFormUrl, editFormUrl and newFormUrl. The values of these properties however are not what you might expect. The value of displayFormUrl for example is something like http://myServer/_layouts/15/listform.aspx?
PageType=4&ListId=%7BD416B014%2DBDCA%2D4561%2D954C%2D7B43D3B66520%7D. Normally you would expect this to be more like http://myServer/Lists/myList/DispForm.aspx.
The good news is while the values of these properties look strange, they actually work. They redirect to the appropriate list form (that is display, edit or new).
So, to get the display URL for a list item, you should use the code below:
renderingContext.displayFormUrl + “&ID=” + renderingContent.CurrentItem.ID
Use the same approach to get the edit URL for the item, or the new item URL for the list.