CFGRID: How can you conditionally change the background of a particular cell?
Hello,
I currently have a table that displays the data from a query. I would like to make it more flexible so I would like to use CFGRID to output the information instead (for pagination, sorting, outputting to MS Excel etc.).
However, I need to change the cell color of certain fields based on the data in those fields. For instance, if the value in the certain field is 0-30 I need it to be red, if it is 31-60 I need it to be yellow and 61-100 I need it to be green.
I remember doing this last summer for one of my clients, but I was under a fairly strict NDA and couldn't keep any of my notes/code and I don't recall much about how I went about doing this. There is probably a better way than what I did in any event.
I think it had something to do with writing the query to a new query and wrapping the values with some CSS code for the color as i processed it.
I rather doubt that I am the first person to ask this question, but I haven't been having much luck finding the answer so far. If someone can help me figure this out, it would be greatly appreciated. If anyone knows of an existing answer already in these forums, that would be awesome!
Best regards,
KK
