My question is similar to Implementing a hyperlink within a dojo datagrid, and I'm successfully able to add markup for hyperlinks to a Dojo grid using a formatter.
However, I need to wire up a click events on these hyperlinks, to trigger a function within the Dijit containing the grid.
I have a formatter like the following:
var createEditLinks = function (data) {
return '<a class="my-css-class" href="#" onclick="myFunctionInsideTheDijit()">' + data.title + '</a>'
}
While this works (I do get the markup inside the grid cell), the myFunctionInsideTheDijit function is unavailable (unless I would declare it on the global scope).
I've looked a little at dom-construct, but I just can't figure out how to add a hyperlink that invokes a Dijit function when clicked.
Any help is greatly appreciated! Thanks!