3.2.0

Set Row as bold based on another column value.

Thanks in Response.


<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"/>
</Alarms>

Based on @Ack value i.e. if @Ack value is not null, i want to make my entire row as bold.

I don't know how to do that.
Narayana Swamy, Bangalore
September 10,
Based on the recent post:
http://www.activewidgets.com/javascript.forum.20517.5/applying-colors-to-rows-and.html
your testing code should look like this:
<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>
Carlos
September 10,
Thanks Carlos,

Its working fine. I want some more information like how to differentiate whether we are clicked on row of a grid and whether its right click or left click of mouse.

Is there any solution to differentiate the event on row.

Thanks in response.
Narayana Swamy, Bangalore
September 11,

This topic is archived.

See also:


Back to support forum