:: Forum >> Version 2 >>

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

More information on this topic is available in the documentation section: /grid.howto.cells/images.html.

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
Wednesday, June 14, 2006
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(colrow){return col "." row});
    
obj.setHeaderText("header");

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

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

    
obj.setCellTemplate(new AW.Templates.Image0);
    
obj.setCellImage(image0);


    
document.write(obj);
 
see also

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



This topic is archived.

Back to /grid.howto.cells/images.html

Documentation:

Forum search