:: Forum >>

getting cell links from AW.XML.Table

Since my cell data comes from an AW.XML.Table request to the server, I need the cell link data to do so also.

There are plenty of examples of using a static jscript array and something like:

reportGrid.setCellLink(function(c, r){ return reportLinks[r][c]; }, 0);

for example to set all of the links for column 0.

But I really want that data to come from the server directly.

Anyone have ideas on how to do that?

Thanks!!
Gary
Monday, March 20, 2006

http://www.activewidgets.com/javascript.forum.9812.5/setcelllink-in-2-0.html
Alex (ActiveWidgets)
Tuesday, March 21, 2006
Hey Gary, I'm not sure if what I'm doing would help you ... but if it does, let me know and I can post a link for you so you can look at hte source of how I'm doing it.

I have an XML data source. In it, I have 33 columns (but I'm only use 14 columns in the grid). There are 5 columns where I have to convert the data provided in the XML source into links - and, to boot, those links have to be displayed as images.

With the help of another AW User, (ok, he pretty much gave me the code), I'm using this:

obj.setCellText(function(col,row){
return "<a target='_new' href='http://www.domain.com/isa/"+ this.getCellValue(16,row) + "'><img border='0' src='http://www.domain.com/images/"+ this.getCellValue(21,row) + ".gif'></a>"
}


Here is what it is doing:
It is the cell value of column 16 (which is a PDF filename - carl.pdf) and adding the URL to the front of it. Then, it is taking the value from column 12 (which is a status code of "green" "red" "yellow"), adding the image url infront of that and adding ".gif" to the end.

What I get in the grid is a GREEN.GIf image that when clicked on launches the carl.pdf in a new window.

Because I'm leaving it as "celltext" and not using the link template, I can build the code anyway I need - my needs was for a particular column in the grid to have upto 2 different links in it.

If you'd like to see a function example of my grid, let me know. I can give you a URL.
Carl
Wednesday, March 22, 2006

This topic is archived.


Back to support forum

Forum search