Dynamic URL Image in Ver 2 using a custom Template
Hi,
I'm trying to get a dynamically assigned URL images to work in the grid (version 2.0) using a modified version 1 image template I got from the forum. (http://www.activewidgets.com/javascript.forum.560.5/xml-images-in-grid-iii.html)
Applied by :
for example.
However the statement "return this.getItemProperty("text");" generates an error saying getItemProperty is not a function.
I am not very familiar with the internal class workings of AW version 2, so can Alex (or anyone else) please explain how has changed in the version 2 model, and then how can I update this template to work properly?
Many thanks in advance.
I'm trying to get a dynamically assigned URL images to work in the grid (version 2.0) using a modified version 1 image template I got from the forum. (http://www.activewidgets.com/javascript.forum.560.5/xml-images-in-grid-iii.html)
if (!window.My) My=[];
if (!My.Templates) My.Templates=[];
My.Templates.Image = AW.System.Control.subclass();
My.Templates.Image.create = function(){
var subClass = this.prototype;
var image = new AW.HTML.IMG;
image.setAttribute("src",function(){
return this.getItemProperty("text");
//return "images/test.jpg"
});
image.setAttribute("align","middle");
subClass.setContent("image", image);
};
My.Templates.Image.create();
Applied by :
grid.setCellTemplate(new My.Templates.Image, 0);
for example.
However the statement "return this.getItemProperty("text");" generates an error saying getItemProperty is not a function.
I am not very familiar with the internal class workings of AW version 2, so can Alex (or anyone else) please explain how has changed in the version 2 model, and then how can I update this template to work properly?
Many thanks in advance.
StefK
February 26,