3.2.0

Multiple column links inheriting same link value...help!?

So I'm working with a grid that has several different links that are the same for each column, but different for each row. the problem is that my code seems to want to grab the last link value and apply it to all the other columns. Anyone have any better ideas on how to condense and clean up this code?

//	COLUMN 14 LINK  ---for a google maps address lookup from excel
    var myLinks = function(column, row){ 
    	return "http://maps.google.com/maps?q=" + this.getCellText(0, row) + this.getCellText(1, row) + this.getCellText(2, 

row); 
    } 

    obj.setCellLink(myLinks); 
    obj.setCellTemplate(new AW.Templates.Link, 14);

//	COLUMN 15 LINK  ---- for a zillow address lookup from excel
    var myLinks = function(column, row){ 
    	return "http://www.zillow.com/search/RealEstateSearch.htm?dg=dg1&addrstrthood=" + this.getCellText(0, row) + "&citystatezip=" + this.getCellText(1, row) + this.getCellText(2, row) + this.getCellText(3, row) + "&GOButton=%3CSPAN%3EGO%3C%2FSPAN%3E"; 
    } 

    obj.setCellLink(myLinks); 
    obj.setCellTemplate(new AW.Templates.Link, 15); // last number idicates column to put link in

//	COLUMN 16 LINK   ----random additional link 
    var myLinks = function(column, row){ 
    	return "http://www.anydomain.com" + this.getCellText (16, row); 
    } 

    obj.setCellLink(myLinks); 
    obj.setCellTemplate(new AW.Templates.Link, 16);


The problem is that when all three links are coded on top of each other they all end up taking the same link as the last coded link. ie: the link in column 16 gets attributed to column 15 14 and so on.

How can I fix it? Help?
linkcrazy
March 11,
You should use column index when you assign the link function (otherwise each time the function is applied to all columns) -

obj.setCellLink(myLinks, 14);
...
obj.setCellLink(myLinks, 15);
...
obj.setCellLink(myLinks, 16);
Alex (ActiveWidgets)
March 11,
Nice, it works perfectly (of course)... I'm new so thanks for putting up with my inexperience and lack of talent.

I love ActiveWidgets!!! Keep up the great work and thank you for the prompt response.
March 11,

This topic is archived.

See also:


Back to support forum