I have a jqgrid and am calling 'returnHyperLink' in my custom formatter. This code works fine, and goes to the link I am requesting:
function returnHyperLink(cellValue, options, rowdata, action) {
return '<a id="myLink" href="#" onclick="switchPage(\''+cellValue+'\');">'+cellValue+'</a>'
}
function switchPage(cellValue) {
$("#contents").load("jsp/newpage.jsp");
}
But I would like to add one more parameter when calling calling switchPage
from returnHyperLink
.
I am looking for the correct formatting to something like this:
function returnHyperLink(cellValue, options, rowdata, action) {
return '<a id="myLink" href="#" onclick="switchPage(\''+cellValue+'\', \''+rowdata+'\');">'+cellValue+'</a>'
}
So that I can access that particular rowdata object
and extract information from it before calling $("#contents").load("jsp/newpage.jsp");
in switchPage
Obviously, my new switchPage function would look like this:
function switchPage(cellValue, rowdata)