:: Forum >> Version 2 >>

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(colrow){ 
        if (
this.getCellText(colrow).match(/Urgent/) || this.getCellText(colrow).match(/Global/))
          return 
"red";
        else if (
this.getCellText(colrow).match(/High/))
          return 
"yellow";
        else
          return;  
    }); 

    
table.defineCellProperty("color", function(colrow){ 
        if (
this.getCellText(colrow).match(/Urgent/) || this.getCellText(colrow).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
Friday, June 30, 2006



This topic is archived.

Back to support forum

Forum search