<html>
<head>
<title></title>
<style>body {font: 12px Tahoma}</style>
<script src="../../runtime/lib/aw.js"></script>
<link href="../../runtime/styles/xp/aw.css" rel="stylesheet"></link>
<style>
#myGrid {height: 200px; width: 500px;}
#myGrid .aw-grid-row {border-bottom: 1px solid threedlightshadow;}
#myGrid .aw-grid-cell {border-right: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
ImageTemplate = AW.Templates.ImageText.subclass();
ImageTemplate.create = function(){
var obj = this.prototype;
var image = obj.getContent("box/image");
image.setTag("img");
image.setClass("image", "");
image.setAttribute("src", function() {
if (this.$0 != null && this.$1 != null) {
return "../images - adding new/" + this.$owner.getCellText(this.$0, this.$1);
}
return "";
});
obj.setContent("box/image", image);
obj.setContent("box/text", "");
};
var table = new AW.CSV.Table;
table.setURL("image.csv");
table.request();
var obj = new AW.UI.Grid;
obj.setId("myGrid");
var columns = ["Number", "Image", "Text"];
obj.setCellTemplate(new ImageTemplate, 1);
obj.setHeaderText(columns);
obj.setColumnCount(3);
obj.setCellModel(table);
document.write(obj);
</script>
</body>
</html>
This topic is archived.