:: Forum >>

Bug on setting row background after validation?

obj.setVirtualMode(true);

obj.onCellValidated = function(text, column, row){

var obj = AW.object("mygrid")
// doing something here then setting the row color
obj.getRowTemplate(row).setStyle("background","red");
obj.getRowTemplate(row).refresh();
}


Any workaround?
Cal
Friday, March 30, 2007
The behavior I see with the above snippett is the grid freezes and doesnt respond to clicking other cells.
Cal
Friday, March 30, 2007
Yes, the grid breaks if you refresh the row during editing. Actually with AW.UI.Grid class you don't need the refresh() call - the setStyle method modifies element style immediately and there is no need to recreate the html string.

There might be a problem with AW.Grid.Extended class where each row actually has three segments - left fixed segment, central scrolling segment and the right fixed segment. The getRowTemplate(row) call returns the abstract row (prototype), and not the individual segments. To update the styles on each segment you have to call them with additional segment index -

obj.onCellValidated = function(text, col, row){
    this.getRowTemplate(row, 0).setStyle("background", "red");
    this.getRowTemplate(row, 1).setStyle("background", "red");
    this.getRowTemplate(row, 2).setStyle("background", "red");
}
Alex (ActiveWidgets)
Saturday, March 31, 2007
Thanks for the response Alex, I was using the Extended class, I went back to using the AW.UI.Grid and took out refresh and that solved my issue.
Cal
Monday, April 2, 2007

This topic is archived.


Back to support forum

Forum search