:: Forum >>

Multiple images in grid frmo XML

I have and XML file with an possible image in the first 2 elements. The image should only appear when I have the element populated. I am using the model for getImage() as descrifed in the example file for XML elements. My problem is that when I call getImage() a second time to get the next image, it overwrites the first call so I only get the last image in all the columns.

(example code)
var table = new AW.XML.Table;
table.setURL("myfile.xml");

table.getImage = function(col, row){
return this.getData(0, row);
}

table.getImage = function(col, row){
return this.getData(1, row);
}

table.request();
.
.(standard obj setup code is here...)
.
obj.setCellTemplate(new AW.Templates.Image, 0);
obj.setCellTemplate(new AW.Templates.Image, 1);

How do I read the images and assign them to the appropriate cell?

Thanks.
JimV
Friday, September 28, 2007
The getImage method should probably use column index as well -

table.getImage = function(col, row){
return this.getData(col, row);
}
Alex (ActiveWidgets)
Monday, October 1, 2007
Thanks Alex - that was my problem (also solved the links issue I was having with images and links). Great product!
JimV
Monday, October 1, 2007

This topic is archived.


Back to support forum

Forum search