Hi Alex,
In the previous version i used to use this for
changing the bgColor of column
obj.getColumnTemplate(2).setStyle("background-color", myColor);

How can i do it under this release ?
October 6,
With v2.0

obj.getCellTemplate(1).setStyle("background-color", "#ccc");


.aw-column-1 {background: #ccc;}

Alex (ActiveWidgets)
October 6,
Hi Alex,
thanx for da reply
I figured out that much but the problem i am getting that i wanna set color using the "text" of the cell.
so i called
obj.getCellTemplate(1).setStyle("background-color", myColor);

in myColor method i was extracting value using
var value =this.getItemProperty("text");

this is no longer working.... so i was actually soughting the alternative of this.
October 7,
is there any way to get the cell text ?
October 10,
Yes, you can retrieve current cell text (while inside template) with the folowing call:

var text = this.getControlProperty("text");

Here is more generic code which allows you to get data from other columns as well:

var obj = new AW.UI.Grid;

    obj.setCellText(function(col, row){return col + "." + row});

    // add new cell property
    obj.defineCellProperty("color", function(col, row){
        var text = this.getCellText(col, row);
        return text.match(/[234]/) ? "red" : "white";

    // assign color property to column-1 background
    obj.getCellTemplate(1).setStyle("background-color", function(){
        return this.getControlProperty("color");

Alex (ActiveWidgets)
October 10,
Thanks! :-)
October 11,

This topic is archived.

See also:

Back to support forum