3.2.0

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
April 17,
http://www.activewidgets.com/javascript.forum.15581.3/getcurrentrow.html
April 18,
see also getRowPosition()
April 18,
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
April 20,

This topic is archived.

See also:


Back to support forum