:: Forum >>
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);
Yogesh
Friday, April 17, 2009
Saturday, April 18, 2009
see also getRowPosition()
Saturday, April 18, 2009
Thnx. I had seen the earlier posts but somehow in my particular case(given above) it doesnt work right.
Anyway, this is what i did.
I created a user defined property called idx
grid1.defineRowProperty("idx",function(col,row){return row}) ;
and i access this property in my function given above at the highlighted place. What happens at runtime is that for every row this idx property is then set to the correct row number and i can make use of it.
Yogesh
Monday, April 20, 2009
This topic is archived.
Back to support forum
Forum search