You need to pass a row, not a rowindex, to dataItem.
You could try something like this, though:
Or, you could define a custom data attribute in a template for that cell.
"# FirstName #"
#= FirstName #
And, in your code, look for a matching value like this:
"td[data-first-name='" + reference + "']"
rowindex = cell.parent().rowIndex;
and that will give you the rowindex of the grid where the match was found.