Text in the first column based on numeric cell value
Hi,
I use setSelectorText to add text or image to the first column on a grid, but this text or image must be different if the value on the cell is more or equal to 1
For example, can you tell me how to put the number 2 on the first column if the value on a cell in the second row is more or equal to 1
(I am also trying to change the background color to red .."if the value on a cell in the second row is more or equal to 1")
I am using the code below. Any idea?
-------------------------
<script>
var myHeaders = ["Test","Test2","Test3"];
var myCells = [
["Temp","14","On"],
["Temp","0","On"],
["Temp","1","On"],
["Temp","5","Off"],
["Temp","5","Off"] ];
var obj = new AW.UI.Grid;
obj.setHeaderText(myHeaders);
obj.setCellText(myCells);
obj.setSelectorVisible(true);
obj.setSelectorWidth(15);
obj.setSelectorText("1");
obj.setColumnCount(myHeaders.length);
obj.setRowCount(myCells.length);
document.write(obj);
</script>
-------------------------
I use setSelectorText to add text or image to the first column on a grid, but this text or image must be different if the value on the cell is more or equal to 1
For example, can you tell me how to put the number 2 on the first column if the value on a cell in the second row is more or equal to 1
(I am also trying to change the background color to red .."if the value on a cell in the second row is more or equal to 1")
I am using the code below. Any idea?
-------------------------
<script>
var myHeaders = ["Test","Test2","Test3"];
var myCells = [
["Temp","14","On"],
["Temp","0","On"],
["Temp","1","On"],
["Temp","5","Off"],
["Temp","5","Off"] ];
var obj = new AW.UI.Grid;
obj.setHeaderText(myHeaders);
obj.setCellText(myCells);
obj.setSelectorVisible(true);
obj.setSelectorWidth(15);
obj.setSelectorText("1");
obj.setColumnCount(myHeaders.length);
obj.setRowCount(myCells.length);
document.write(obj);
</script>
-------------------------
Angel
July 4,