:: Forum >>

Alex- need help selecting a check box

I need to select a checkbox value based on the condition that column 4 is equal to the id. the checkbox is in the first column. Thanks in advance.

for(var i=0;i<grid1.getRowCount();i++){
if(grid1.getCellValue(4,i) == '<%=request.getAttribute("Id")%>'){
//need the selection code here. The check box is in first column.
}
}
Prabhat
Thursday, June 14, 2007
Is this before or after the grid is painted to the screen?

if it is before:
grid1.setCellValue(true, 0, i);

should do the trick
Justin
Friday, June 15, 2007
It is after the grid is painted. Here is the actual code.

var grid1 = new AW.UI.Grid;
grid1.setVirtualMode(false);
grid1.setId("grid1");
grid1.setCellText(myCells);
grid1.setHeaderText(myHeaders);
grid1.setColumnCount(4);
grid1.setRowCount(<%=size%>);
grid1.setColumnWidth(20, 0);
grid1.setColumnWidth(180, 1);
grid1.setColumnWidth(150,2)
grid1.setColumnWidth(175, 3);
grid1.setColumnWidth(25, 4);
grid1.setCellTemplate(new AW.Templates.CheckBox, 0);
grid1.getRowTemplate().setStyle("text-decoration", "underline");
grid1.refresh();
for(var i=0;i<grid1.getRowCount();i++){
if(grid1.getCellValue(4,i) == '<%=request.getAttribute("Id")%>') {
//need code to check the checkbox here.
}
}
Prabhat
Monday, June 18, 2007
have you tried
grid1.setCellValue(true, 0, i);
grid1.refresh();
?
Justin
Tuesday, July 3, 2007
that will be (true, 4, i); sorry
Justin
Tuesday, July 3, 2007
Thanks. It works. Actually it worked the first time, I had some typo. Thanks.
Prabhat
Tuesday, July 3, 2007

This topic is archived.


Back to support forum

Forum search