3.2.0

how do i add an image to the first column based on cell value?

ive searched and found several threads but did not find anything that worked. what i need is to add a column that only contains an icon that indicates if something is of low/normal/high priority like outlook based on the value.

thanks for any help in advance!
loo
June 14,
You should use AW.Templates.Image class and also make a function which returns image names out of grid data -

var obj = new AW.UI.Grid;
    obj.setCellData(function(col, row){return col + "." + row});
    obj.setHeaderText("header");

    obj.setColumnCount(10);
    obj.setRowCount(10);

    function image(col, row){
        if (this.getCellText(0, row) == "0.1") {
            return "search";
        }
        else {
            return "favorites";
        }
    }

    obj.setCellTemplate(new AW.Templates.Image, 0);
    obj.setCellImage(image, 0);


    document.write(obj);


see also

http://www.activewidgets.com/grid.howto.cells/images.html
Alex (ActiveWidgets)
June 14,
thanks...worked perfect!
loo
June 14,

This topic is archived.

See also:


Back to support forum