hi, i have a grid and i need to change the color of one column dynamically
{
header: "Status",
dataIndex: 'Status',
width: 80,
renderer: renderStatus,
editor: myComboStatusForGrid
},
i define the renderer to set the text color of this column:
function renderStatus(data, cell, record, rowIndex, columnIndex, store){
switch(data) {
case "Pending":
cell.css = "orangetext";
return "Pending";
case "Passed":
cell.css = "greentext";
return "Passed";
case "Failed":
cell.css = "redtext";
return "Failed";
case "Obsolete":
cell.css = "graytext";
return "Obsolete";
}
};
in css:
.redtext {color: #FF0000 !important;}
.yellowtext {color: #FFFF00 !important;}
.greentext {color: #00CC00 !important;}
.graytext {color: #808080 !important;}
.orangetext {color: #FF9900 !important;}
this works well, but i also need to change the background color of this column based on different profile:
function login(){
var profile;
if(profile ='admin')
{
//set the bg color = red
//myGrid.getColumnModel().getColumnById('Status').css= "redbg";
}
else if(profile = 'manage')
{
//set bg color = green
}
}
anyone know how to change the dynamic bg color ?? thx