<html>
<head>
<script src="/ActiveWidgets/runtime/lib/aw.js"></script>
<link href="/ActiveWidgets/runtime/styles/aqua/aw.css" rel="stylesheet"></link>
<style>
#obj { width: 400px; height: 300px; }
#obj .aw-grid-row {height: 20px; border-bottom: 1px solid #ccc;}
#obj .aw-alternate-even {background: #fff;}
#obj .aw-alternate-odd {background: #eee;}
#obj .aw-mouseover-row {background: #c0c0c0;}
#obj .aw-mousedown-row {background: #999;}
#obj .aw-rows-selected {background: #316ac5!important; }
</style>
</head>
<body>
<script>
var obj = new AW.UI.Grid;
obj.setId('obj');
obj.setHeaderText("header");
obj.setCellText("cell");
obj.setColumnCount(3);
obj.setRowCount(12);
obj.setSelectionMode("single-row");
obj.defineCellProperty("bgcolor", function(col, row){
if (row % 4 == 0) {
return 'red';
}
});
obj.defineCellProperty("color", function(col, row){
if (row % 4 == 0) {
return 'white';
}
});
obj.getCellTemplate().setStyle("background-color", function(){
return this.getControlProperty("bgcolor");
});
obj.getCellTemplate().setStyle("color", function(){
return this.getControlProperty("color");
});
document.write(obj);
</script>
</body>
</html>
#obj .aw-rows-selected .aw-grid-cell {background: none!important; }
obj.defineCellProperty("color", function(col, row){
if (row % 4 == 0) {
return 'green';
}
});
#obj .aw-rows-selected .aw-grid-cell {color: white!important; }
This topic is archived.