Check Box & Images in single Column
Hi
Thanks in response.
<Alarms><Alarm AlarmId="1" Age="0:03 " AlarmName="AIRFLOW INCHES" AlarmType="Input Point" Assignment=" " CompanyID="000 " Esc="0 " Lapsed="974:49 " LoggedTime="2007-07-25 20:15:25.92" Nts="note" Pri="10 " SystemID="18500 " SystemName="TE5-Savvy31 " TimeOccurred="2007-07-25 16:12:00.0"/>
<Alarm AlarmId="2" Age="0:03 " AlarmName="HEAT 2/CLOSED" AlarmType="Output Point" Assignment="EAMadministrator " CompanyID="000 " Esc="0 " Lapsed="974:49 " LoggedTime="2007-07-25 20:15:25.937" Nts="note" Pri="10 " SystemID="18500 " SystemName="TE5-Savvy31" TimeOccurred="2007-07-25 16:12:00.0"/>
</Alarms>
This is my sample xml file as a string i have in my jsp.
Now my question is......I want to display this data in AW grid component. In third column i want display one check box with name & values as AlarmId in my xml string.
This is my JSP code.
var ServerXML ='<%=xmlStr%>'; // Here actual xml string will come up
var table = new AW.XML.Table;
table.setXML(ServerXML);
//Here i am setting my data into the grid.
table.setColumns(["@Esc", "@Pri", "@CompanyID", "@SystemID", "@SystemName","@AlarmName","@AlarmType","@TimeOccurred","@Age","@LoggedTime","@Lapsed","@Nts","@Assignment"]);
var columns = ["E", "P", "CC", "Sys #", "System Name","Alarm Name","Alarm Type","Occurred","Age","Logged","Lapsed","Nts","Assigned"];
//Can we write like this to display check box in my grid is it possible.
table.setColumns(["@Esc", "@Pri","<input type=checkbox name=@AlarmId value=@AlarmId onclick='javascript:findABC(this.value)'>" "@CompanyID", "@SystemID", "@SystemName","@AlarmName","@AlarmType","@TimeOccurred","@Age","@LoggedTime","@Lapsed","@Nts","@Assignment"]);
var columns = ["E", "P","s", "CC", "Sys #", "System Name","Alarm Name","Alarm Type","Occurred","Age","Logged","Lapsed","Nts","Assigned"];
var obj = new AW.UI.Grid;
obj.setId("myGrid");
obj.setCellTemplate(new AW.Templates.Image,11);
obj.setCellImage("note",11);
obj.setColumnCount(13);
obj.setRowCount(table.getCount());
obj.setHeaderText(columns);
obj.setRowHeight(30);
obj.setSelectorVisible(false);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectorWidth(25);
obj.setSelectionMode("multi-row");
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
obj.setCellFormat([num,num,num,num,str,str,str,str,str,str,str,str,str]);
obj.setCellModel(table);
document.write(obj);
Thanks in response.
<Alarms><Alarm AlarmId="1" Age="0:03 " AlarmName="AIRFLOW INCHES" AlarmType="Input Point" Assignment=" " CompanyID="000 " Esc="0 " Lapsed="974:49 " LoggedTime="2007-07-25 20:15:25.92" Nts="note" Pri="10 " SystemID="18500 " SystemName="TE5-Savvy31 " TimeOccurred="2007-07-25 16:12:00.0"/>
<Alarm AlarmId="2" Age="0:03 " AlarmName="HEAT 2/CLOSED" AlarmType="Output Point" Assignment="EAMadministrator " CompanyID="000 " Esc="0 " Lapsed="974:49 " LoggedTime="2007-07-25 20:15:25.937" Nts="note" Pri="10 " SystemID="18500 " SystemName="TE5-Savvy31" TimeOccurred="2007-07-25 16:12:00.0"/>
</Alarms>
This is my sample xml file as a string i have in my jsp.
Now my question is......I want to display this data in AW grid component. In third column i want display one check box with name & values as AlarmId in my xml string.
This is my JSP code.
var ServerXML ='<%=xmlStr%>'; // Here actual xml string will come up
var table = new AW.XML.Table;
table.setXML(ServerXML);
//Here i am setting my data into the grid.
table.setColumns(["@Esc", "@Pri", "@CompanyID", "@SystemID", "@SystemName","@AlarmName","@AlarmType","@TimeOccurred","@Age","@LoggedTime","@Lapsed","@Nts","@Assignment"]);
var columns = ["E", "P", "CC", "Sys #", "System Name","Alarm Name","Alarm Type","Occurred","Age","Logged","Lapsed","Nts","Assigned"];
//Can we write like this to display check box in my grid is it possible.
table.setColumns(["@Esc", "@Pri","<input type=checkbox name=@AlarmId value=@AlarmId onclick='javascript:findABC(this.value)'>" "@CompanyID", "@SystemID", "@SystemName","@AlarmName","@AlarmType","@TimeOccurred","@Age","@LoggedTime","@Lapsed","@Nts","@Assignment"]);
var columns = ["E", "P","s", "CC", "Sys #", "System Name","Alarm Name","Alarm Type","Occurred","Age","Logged","Lapsed","Nts","Assigned"];
var obj = new AW.UI.Grid;
obj.setId("myGrid");
obj.setCellTemplate(new AW.Templates.Image,11);
obj.setCellImage("note",11);
obj.setColumnCount(13);
obj.setRowCount(table.getCount());
obj.setHeaderText(columns);
obj.setRowHeight(30);
obj.setSelectorVisible(false);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectorWidth(25);
obj.setSelectionMode("multi-row");
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
obj.setCellFormat([num,num,num,num,str,str,str,str,str,str,str,str,str]);
obj.setCellModel(table);
document.write(obj);
Narayana Swamy, Bangalore
September 4,