3.0 beta 2

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
June 14,
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
June 15,
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
June 18,
have you tried
grid1.setCellValue(true, 0, i);
grid1.refresh();
?
Justin
July 3,
that will be (true, 4, i); sorry
Justin
July 3,
Thanks. It works. Actually it worked the first time, I had some typo. Thanks.
Prabhat
July 3,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.