Hi Guys,
I have this custom rendering applied from this site
http://alagad.com/2010/03/31/ask-an-alagadian-how-can-i-style-a-cell-in-lt-cfgrid-gt-based-on-the-data-it-contains/
But its only rendering everything in the first style - it wont change the style
based on the IF statement.
Below is my code:
<script>
formatStatus = function(data,cell,record,row,col,store) {
if (data == 'false')
{
cell.css = 'status1';
}
else
{
cell.css = 'status2';
}
return data
}
formatCells = function() {
theGrid = ColdFusion.Grid.getGridObject('grid1');
cm = theGrid.getColumnModel();
cm.setRenderer(9,formatStatus);
}
</script>
<style>
.status1{border:0px solid #000; background-color:#66FF66; }
.status2{border:0px solid #000; background-color:#ffff00; }
</style>
So you can see i have 2 styles - my problem is everything is getting rendered
in status1 no matter if i change the IF statement.
Its as if there is a problem with the If statment.
If someone could help as i have to do a presentation on this tomorrow and i
have only realised during a practice run of the demo!
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357422
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm