<html>
<head>
<title>ActiveWidgets Examples</title>
<style>body {font: 12px Tahoma}</style>
<script src="../../runtime/lib/aw.js"></script>
<link href="../../runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<xml id="xmlDataIsland">
<Alarms>
<Alarm Ack="qwer" Age="0:03" AlarmId="114" AlarmName="Input Sensor" AlarmType="Input Point" Assignment=" " CompanyID="000" ChkType="true" Esc="0 " Lapsed="07:10" LoggedTime="2007-07-25 20:15:25.327" Nts="note" Pri="1 " PriorityColor="#FF0000" Status="0" SystemID="18500 " SystemName="TE5-Savvy31" TimeOccurred="2007-07-25 16:12:00.0"/>
<Alarm Ack="null" Age="0:03" AlarmId="114" AlarmName="Input Sensor" AlarmType="Input Point" Assignment=" " CompanyID="000" ChkType="true" Esc="0 " Lapsed="07:10" LoggedTime="2007-07-25 20:15:25.327" Nts="note" Pri="1 " PriorityColor="#FF0000" Status="0" SystemID="18500 " SystemName="TE5-Savvy31" TimeOccurred="2007-07-25 16:12:00.0"/>
</Alarms>
</xml>
<script>
var table = new AW.XML.Table;
var xml = document.getElementById("xmlDataIsland");
table.setColumns(["@Ack", "@Age", "@AlarmId", "@AlarmName", "@AlarmType", "@Assignment", "@CompanyID", "@ChkType", "@Esc", "@Lapsed", "@LoggedTime", "@Nts", "@Pri", "@PriorityColor", "@Status", "@SystemID", "@SystemName", "@TimeOccurred" ]);
table.setXML(xml);
var obj = new AW.UI.Grid;
obj.setId("myGrid");
obj.setColumnCount(18);
obj.setRowCount(table.getCount());
obj.setCellModel(table);
obj.defineRowProperty("AckNullInBold", function(r){
if(this.getCellText(0, r)!="null"){return 'bold'};
});
var myRow = new AW.Grid.Row;
myRow.setStyle("font-weight", function(){
return this.getRowProperty("AckNullInBold");
});
obj.setRowTemplate(myRow);
document.write(obj);
</script>
</body>
</html>
This topic is archived.