After an exhaustive search for a solution, what I have come up with isn't working as the cell color isn't changing color. The alerts are alerting as expeted and correctly. Anyone have a clue what might be wrong?
formatStatus = function(data,cell,record,row,col,store) {
statusValue = record.get('NAME_STATUS').trim();
TDPcountValue = record.get('TDPCOUNT');
if (statusValue == 'TDP REQUESTED') {
if (TDPcountValue > 44) {
alert('Red Status: '+statusValue+' Count: '+TDPcountValue);
cell.css = '45Days';
}
else if (TDPcountValue < 30) {
alert('Okay: '+statusValue+' Count: '+TDPcountValue);
}
else {
alert('Yellow Status: '+statusValue+' Count: '+TDPcountValue);
cell.css = '30Days';
}
}
return statusValue;
}
formatCells = function() {
theGrid = ColdFusion.Grid.getGridObject('requestGrid');
cm = theGrid.getColumnModel();
cm.setRenderer(10,formatStatus);
}
<style>
.30Days {
background:#FFFF00; !Important
}
.45Days {
background:#FF00000; !Important
}
</style>
<cfset ajaxOnLoad("formatCells")>
Any help in the right direction would be great, thanks in advance!!
formatStatus = function(data,cell,record,row,col,store) {
statusValue = record.get('NAME_STATUS').trim();
TDPcountValue = record.get('TDPCOUNT');
if (statusValue == 'TDP REQUESTED') {
if (TDPcountValue > 29 && TDPcountValue < 45) {
cell.attr += 'style="background-color:yellow;"';
//alert('Yellow Status: '+statusValue+' Count: '+TDPcountValue);
}
else if (TDPcountValue > 44) {
//alert('Red Status: '+statusValue+' Count: '+TDPcountValue);
cell.attr += 'style="background-color:red;color:white;"';
}
else if (TDPcountValue < 30) {
//alert('Okay: '+statusValue+' Count: '+TDPcountValue);
}
}
return statusValue;
}
formatCells = function() {
theGrid = ColdFusion.Grid.getGridObject('requestGrid');
cm = theGrid.getColumnModel();
cm.setRenderer(10,formatStatus);
}
It seems that 'cell.attr' was the trick I needed instead of cell.css. Thanks to all for helping.