Cell Format
I have, what seems to be (based on coming up empty in this form) a fairly different problem.
I am loading XML data into a table and then displaying that table in a grid. Fairly normal so far...But on top of that, I'm cross referencing the data in the table with a javascript array. If a record matches, I'd like to change the display of the grid cell to something different.
So far, what I have done is added code to table.response
This seems to work, but it seems very hacked together. Is there a better way? It seems like I should be able to do this with a format, but I cant seem to figure that one out.
On top of this, I am periodically refreshing my javascript array and the table which refreshes the grid. The problem is that if a row is removed the grd.setCellText set from the above code is still active. So the image set in row 0 col 5 is always there untill a full browser refresh.
Any help would be appreciated.
Thanks
I am loading XML data into a table and then displaying that table in a grid. Fairly normal so far...But on top of that, I'm cross referencing the data in the table with a javascript array. If a record matches, I'd like to change the display of the grid cell to something different.
So far, what I have done is added code to table.response
var defaultResponse = table.response;
table.response = function(xml){
defaultResponse.call(this, xml);
for (z=0;z<table.getCount();z++){
for (x=0;x<arrayCurrent.length;x++){
if (table.getData(0,z) == arrayCurrent[x][0]){
if (arrayCurrent[x][2] & 0x00001){
grd.setCellText("<span><img src=\"images/img.gif\" /></span>", 4, z);
} else {
grd.setCellText("<span></span>", 4, z);
}
if (arrayCurrent[x][2] & 0x00002){
grd.setCellText("<span><img src=\"images/img.gif\" /></span>", 2, z);
} else {
grd.setCellText("<span></span>", 2, z);
}
if (arrayCurrent[x][2] & 0x00004){
grd.setCellText("<span><img src=\"images/img.gif\" /></span>", 3, z);
} else {
grd.setCellText("<span></span>", 3, z);
}
if (arrayCurrent[x][2] & 0x00008){
grd.setCellText("<span><img src=\"images/img.gif\" /></span>", 5, z);
} else {
grd.setCellText("<span></span>", 5, z);
}
}
}
}
}
This seems to work, but it seems very hacked together. Is there a better way? It seems like I should be able to do this with a format, but I cant seem to figure that one out.
On top of this, I am periodically refreshing my javascript array and the table which refreshes the grid. The problem is that if a row is removed the grd.setCellText set from the above code is still active. So the image set in row 0 col 5 is always there untill a full browser refresh.
Any help would be appreciated.
Thanks
Aaron
December 2,