Paul
Ok i think i begin to understand. One reason it is difficult is that the doc is really unclear.
I can modify some data and update the grid but when i apply
obj.getCellTemplate(2, 3).setStyle("color", "blue")
there is no effect. Here is the code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" ></link>
<script src="runtime/lib/aw.js"></script>
<!-- grid format -->
<style>
.aw-grid-control {height: 100%; width: 100%; margin: 0px; border: none; font: menu;}
.aw-row-selector {text-align: center}
.aw-column-0 {width: 80px;}
.aw-column-1 {width: 200px;}
.aw-column-2 {text-align: right;}
.aw-column-3 {text-align: right;}
.aw-column-4 {text-align: center;}
.aw-grid-cell {border-right: 1px solid threedlightshadow;}
.aw-grid-row {border-bottom: 1px solid threedlightshadow;}
#myGrid .aw-alternate-even {background: #fff;}
#myGrid .aw-alternate-odd {background: #eee;}
</style>
</head>
<body>
<script>
function change()
{
myData["111"][1]="Test";
myData["222"][2]="Test";
//No refresh
}
var myData = [];
myData["111"] = ["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"];
myData["222"] = ["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"];
myData["333"] = ["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"];
myData["444"] = ["CA", "Computer Associates Inter", "15,606.335", "3,164.000"];
myData["555"] = ["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727"];
var myColumns = ["Ticker", "Company Name", "Market Cap.", "$ Sales"];
var obj = new AW.UI.Grid;
obj.setId("myGrid"); // necessary for CSS rules
obj.setCellText(myData);
obj.setHeaderText(myColumns);
obj.setRowIndices(["111", "222", "333", "444", "555"]);
obj.setRowCount(5);
obj.setColumnCount(4);
obj.setSelectorVisible(true);
obj.setSelectorWidth(35);
obj.setSelectorText(function(i){return i});
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
document.write(obj);
alert (myData["111"][0]);
myData["111"][1]="Julien";
myData["222"][2]="Julien";
obj.getRowTemplate("111").getItemTemplate(1).refresh();
obj.getCellTemplate(1, 1).setStyle("color", "red");
obj.getCellTemplate().setStyle("color", "red");
obj.onCellClicked = function(event, col, row){
window.status = "row: " + row + " column: " + col;
};
</script>
<button onclick="change()">Change</button>
<button onclick="addRow()">AddRow</button>