on 03-12-2008 11:08 AM
I have a grid that hold approximately 750 rows of data. I need to take the value of a cell and compare it to two other cells (upper and lower spec). I tried the below code and placed alerts everywhere in the for loop and outside of it. I get the correct data everywhere possible except when it comes time to coloring the cell. At first I thought it was because the grid was not updated after the loop was completed, but it doesn't seem to the case. Can anyone assist me in getting the cell to change color?
--My code is not allowed to be shown here
Edited by: xMII_Training on Mar 12, 2008 7:08 AM
Generally, you should never try to do this "client side" if it can be avoided. Create a BLS transaction with a calculated column called "RowColor". In the expression for that column, use something like:
stringif(Value < Min, "red", stringif(Value > Max, "orange","green"))
Then, in your grid, in the color context configuration, use the column name "RowColor", match mode = string, and assign the text "red", "orange", and "green" to three of the rows, and assign the appropriate color.
Rick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried chnaging cell color using java script .
function colour()
{
var rowcount=document.Display_Grid.getGridObject().getRowCount();
colourRed=document.Display_Grid.createColor("#FC4D4D");
colourGreen=document.Display_Grid.createColor("#51BF51");
colourYellow=document.Display_Grid.createColor("#FEFE63");
for(i=1;i<=rowcount;i++)
{
var dayvalue=document.Display_Grid.getGridObject().getCellValue(i,7);
var days=dayvalue.substring(0,2);
if(days>=3 && days<7)
{
document.Display_Grid.getGridObject().setCellBackgroundColor(i,7,colourYellow);
}
if(days>=7)
{
document.Display_Grid.getGridObject().setCellBackgroundColor(i,7,colourRed);
}
}
}
sriram
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.