:: Forum >>

How do I set an icon and link based on data in another column?

I want to show a photo icon and a link to a photo if a data field is something other than "0". I can set it for every row of data but don't know how to turn this on only for rows that have something other than a "0" in the last field of the data.

Here's my code.

-------------------------------------------------------------
// Create Link based on MakeModel Column
var imageLink = new AW.Templates.ImageText;
obj.setCellTemplate(imageLink, 0);
obj.setCellImage("photo");
obj.setCellLink("javascript:void(1);", 1);
obj.onCellClicked = function(event, col, row){
if (col==0) {
window.open('poppic.php?'+this.getCellText(6, row),'ss','width=1,height=1,resizeable=1');
}
};
-------------------------------------------------------------

What I need is something like...

-------------------------------------------------------------
// Create Link based on MakeModel Column
if (obj.getCellText(6, row) != "0") {
var imageLink = new AW.Templates.ImageText;
obj.setCellTemplate(imageLink, 0);
obj.setCellImage("photo");
obj.setCellLink("javascript:void(1);", 1);
obj.onCellClicked = function(event, col, row){
if (col==0) {
window.open('poppic.php?'+this.getCellText(6, row),'ss','width=1,height=1,resizeable=1');
}
};
}
-------------------------------------------------------------

But of course that doesn't work.

Any help is greatly appreciated.

James Johnston
Thursday, October 1, 2009

This topic is archived.


Back to support forum

Forum search