Finding the current row number in a function
Hi Alex,
I need to find a particular cell value inside a function that i am writing to create a hyperlink text in a cell. See my code below.. In the highlighted part i am expecting it to return me the current row number that is being processed so that i can find a cell value in that current row. But it doesnt work. the call obj.getCurrentRow() always returns me value 0. I am badly stuck at this point. Can you please guide me on how to find the current row number in my function.
var link2 = new AW.Templates.Link;
link2.setAttribute("target","_self");
link2.setAttribute("href",function link_grid1()
{
var urlParamString="";
var url = "/DataLoadProcessAction.action?modeOfAction=ShowFileNames";
var paramsList = "batchDir,webShare,jobNo";
var paramValueList = "1,0,3";
var params = paramsList.split(",");
var paramValues = paramValueList.split(",");
for(i=0;i<params.length;i++)
{
urlParamString=urlParamString + params[i];
var val = paramValues[i];
var s='';
s = grid1.getCellText(val,obj.getCurrentRow());
urlParamString = urlParamString + "=" + s + "&";
}
rowNum++;
return url +"&"+ urlParamString;
});
grid1.setCellTemplate(link2,2);
I need to find a particular cell value inside a function that i am writing to create a hyperlink text in a cell. See my code below.. In the highlighted part i am expecting it to return me the current row number that is being processed so that i can find a cell value in that current row. But it doesnt work. the call obj.getCurrentRow() always returns me value 0. I am badly stuck at this point. Can you please guide me on how to find the current row number in my function.
var link2 = new AW.Templates.Link;
link2.setAttribute("target","_self");
link2.setAttribute("href",function link_grid1()
{
var urlParamString="";
var url = "/DataLoadProcessAction.action?modeOfAction=ShowFileNames";
var paramsList = "batchDir,webShare,jobNo";
var paramValueList = "1,0,3";
var params = paramsList.split(",");
var paramValues = paramValueList.split(",");
for(i=0;i<params.length;i++)
{
urlParamString=urlParamString + params[i];
var val = paramValues[i];
var s='';
s = grid1.getCellText(val,obj.getCurrentRow());
urlParamString = urlParamString + "=" + s + "&";
}
rowNum++;
return url +"&"+ urlParamString;
});
grid1.setCellTemplate(link2,2);
Yogesh
April 17,