Overwriting css's items
Hi,
I am trying to change the color of a row on the basis of value in Column 1 of each row. The issue is that this implementation overwrites the row color as set by the css (alternate row color). For the rows where (text == 'MSFT 2') as shown in code below, the green color is fine but for the other rows, the row color as set by css is gone.
Is there a way to rectify this implementation to avaoid the overwriting of css row color ?
#myGrid_div_grid1 .aw-alternate-even {color:#000000;background:#F2F5F7;}
#myGrid_div_grid1 .aw-alternate-odd {color:#000000;background:#FFFFFF;}
function totalRowColor()
{
// add new row property for background color
gridObj.defineRowProperty("myprop", function(row){
// lets say we check the text from the column 1
var text = this.getCellText(0, row); //column, row
var cellColor='';
if (text == 'MSFT 2') {
cellColor = "green";
}
return cellColor;
});
// assign rowBackground to row template style
gridObj.getRowTemplate().setStyle("background", function(){ return this.getRowProperty("myprop")});
}
I am trying to change the color of a row on the basis of value in Column 1 of each row. The issue is that this implementation overwrites the row color as set by the css (alternate row color). For the rows where (text == 'MSFT 2') as shown in code below, the green color is fine but for the other rows, the row color as set by css is gone.
Is there a way to rectify this implementation to avaoid the overwriting of css row color ?
#myGrid_div_grid1 .aw-alternate-even {color:#000000;background:#F2F5F7;}
#myGrid_div_grid1 .aw-alternate-odd {color:#000000;background:#FFFFFF;}
function totalRowColor()
{
// add new row property for background color
gridObj.defineRowProperty("myprop", function(row){
// lets say we check the text from the column 1
var text = this.getCellText(0, row); //column, row
var cellColor='';
if (text == 'MSFT 2') {
cellColor = "green";
}
return cellColor;
});
// assign rowBackground to row template style
gridObj.getRowTemplate().setStyle("background", function(){ return this.getRowProperty("myprop")});
}
cpuri
July 13,