3.0 beta 2

Grid Refresh Problem

I have a grid which has a Yes and a No column. Each row has an image in those columns that act like checkboxes. When the image of the blank box is checked, it calls a function that exchanges that image for one that has a check mark in the box, etc. This function is working fine.

I want to ungrey out rows below as the user checks the boxes based on their answer. When the image is clicked, I can capture the appropriate row information in a function and perform the row color change. However, this row color change only actually displays if I then do a refresh();. However, this refresh() command is somehow interfering with my image exchange code and preventing that from working properly. Any help would be most appreciated. Here is my function that is called when the checkbox image is clicked:

function picreplace(nm,sr,ob,rw,question,yesact,noact){
obj.getRowTemplate(yesact-1).setStyle("background","#EEEEEE"); //ungrey appropriate row based on answer
obj.refresh();

// submit changes to database
var r = new AW.HTTP.Request;
r.setURL("answerchange.asp");
r.setRequestMethod("POST");
r.setParameter("qid",question)

if(sr==true && (ob.id=="false" || ob.id=="none")){
ob.src = "true.gif"
ob.id = "true"
nm.src = "false.gif"
nm.id = "true"
r.setParameter("answer",nm.id)
r.request();
}
else {
if(sr==false && (ob.id=="true" || ob.id=="none")){
ob.src = "true.gif"
ob.id = "false"
nm.src = "false.gif"
nm.id = "false"
r.setParameter("answer",nm.id)
r.request();
}
else {
if((ob.id=="true" && sr==true) || (ob.id="false" && sr==false)){
ob.src = "false.gif"
ob.id = "none"
nm.src = "false.gif"
nm.id = "none"
r.setParameter("answer",nm.id)
r.request();
}}
}}
March 7,
Probably you should refresh only one row, not the whole grid -

obj.getRowTemplate(yesact-1).refresh();
Alex (ActiveWidgets)
March 7,
Thanks Alex. That seems to have done the trick.
Greg
March 11,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.