3.0.0

Cell Highlighting Consolidation

I have the following code and I am wondering if there is a better way to accomplish the same thing.

table.defineCellProperty("bgcolor", function(col, row){ 
        if (this.getCellText(col, row).match(/Urgent/) || this.getCellText(col, row).match(/Global/))
          return "red";
        else if (this.getCellText(col, row).match(/High/))
          return "yellow";
        else
          return;  
    }); 

    table.defineCellProperty("color", function(col, row){ 
        if (this.getCellText(col, row).match(/Urgent/) || this.getCellText(col, row).match(/Global/))
          return "white";
        else
          return;
    }); 

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

    // assign color property to column-1 background 
    table.getCellTemplate(1).setStyle("color", function(){ 
        return this.getControlProperty("color"); 
    });
Mike
June 30,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.