Bug on setting row background after validation?
obj.setVirtualMode(true);
obj.onCellValidated = function(text, column, row){
var obj = AW.object("mygrid")
obj.getRowTemplate(row).setStyle("background","red");
obj.getRowTemplate(row).refresh();
}
Any workaround?
Cal
March 30,
The behavior I see with the above snippett is the grid freezes and doesnt respond to clicking other cells.
Cal
March 30,
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)
March 31,
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
April 2,