The templates have access to the current dataItem through the data object. In case you are calling an external function from the template you could pass it the dataItem's uid. This will allow you to get the same dataItem from the external function. I created this small example to illustrate such behavior.
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI