Select to view content in your preferred language

Pass Field Parameters to Dojo DataGrid Hyperlink

762
0
12-09-2011 11:55 AM
EmilyLaMunyon
Deactivated User
Hello,

I am trying to create a hyperlink column in the dojo dataGrid that accepts or recognizes field names from my REST service and passes them to a url. I have been able to achieve this with an info template, and am hoping to do the same with the datagrid.

<a href='http://surveyor.slco.org/gis/map/Corner_Reports/surveysimage.cfm?subdir=${subdir}&page_id=${page_id}.pdf'>PDF</a>


I found this info on the ArcGIS Server blog, but have not had any luck:

You can use a custom formatter to insert a hyperlink as well. You can associate a formatter with a field by setting the formatter to a function that creates the link:

<th field="STATE_NAME" formatter="makeLink" width="100px">State</th>

Here's the create a link function, in this case it just takes the state name and builds a hyperlink to the wikipedia entry for that state.

function makeLink(name){

var link =  "<a   href=\"http://en.wikipedia.org/wiki/" + name +  "\" target=\"_blank\">" + name + "</a>";

return link;

}


Any help would be greatly appreciated!!:D
0 Kudos
0 Replies